acklenx/OrgChart

Trying to use on a modern SharePoint Page

Opened this issue · 2 comments

The initial page doesn't load on my SharePoint page. The search function works fine but for some reason, the main page doesn't show up. See the attached screenshot.

image

Any assistance you can provide is appreciated, thanks!

Can you view the console log messages?
What browser are you using (in chrome - Right click on the page, and select "inspect" or "developer tools" then "inspect")

Does it work outside of SharePoint?

What does your data look like? Or are you using the sample data?

Hi! Love this chart! I had this issue and a co-worker posted that message. I was able to resolve by adding window.onload = init();

The body onload="init()" wasn't firing on our SharePoint Intranet page.

       ` function hideSearchResults()
        {
            document.getElementById( 'searchResults' ).style.display = 'none';
            const newHash = "person=" + lastUnsavedId;
            if( newHash && newHash !== "person=null" && ( "#" + newHash ) !== ( document.location.hash ) )
            {
                lastHash = "#" + newHash;
                document.location.hash = newHash;
            }
            setTimeout( function()
                        {
                            document.getElementById( 'searchResults' ).style.display = 'none';
                        }, 10 );  // does this need to be async?
        }
        **window.onload = init();**
    </script>
    </head>
    <body onload="init()">`

I have another question though - is there a way to start the top with just the person block?

example