acklenx / OrgChart

Vanilla JavaScript Organizational Chart - no dependencies
MIT License
9 stars 1 forks source link

Trying to use on a modern SharePoint Page #1

Open worm5406 opened 7 months ago

worm5406 commented 7 months ago

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!

acklenx commented 7 months ago

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?

mason501 commented 2 weeks ago

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