JQuery error - delay load speed?

Hi,

Is there a way to delay the loading of the Org chart by a few milliseconds? Reason for asking is that we have a customised SharePoint intranet pages (using LiveTiles) that use JQuery, the Org Chart is on one of these pages. Occasionally the page that is hosting the org chart fails to load (see screenshot) which I am assuming is because there is a clash between the page customisations and Org Chart. If there was a way to mange the loading of the web part that would be really useful?

Any thoughts gratefully received.

Rob


Hi Rob,

Thank you for your question.

You can delay loading of data. I’m not sure if it can help in your case, but you can try. Use renderer.prerenderAction function to control time of org chart loading.

Just open the configuration wizard and navigate to custom JavaScript step. Then paste the code below into code editor. This function overrides org chart prerender action. Thus, org chart wont be loaded until you call completed function.

You can replace 1000 (1000 milliseconds) with your own value.

[code]renderer.prerenderAction = function(completed){

setTimeout(function(){
completed();
}, 1000);

}[/code]

Thanks Anton, I’ll get that a go and see if it helps.

Hi Anton

As you suspected the error is still happening, and still very random. I’ve been told by LiveTiles to try this code:

However I am a bit stumped how I can use this with your code, JQuery is not my area of expertise.

If you can offer any assistance that would be great.

Rob

Hi Rob,

Are you sure that the issue is actual only for the page with Org Chart?

Org Chart uses isolated jQuery version with non-conflict enabled. It should not conflict with any third party code.

I see that there are no errors in Org Chart code in the screenshot you provided. I assume this issue is mostly on LiveTiles side.

Anyway if you open for edit properties of Org Chart content editor web part, you will see URL of Template.html file. This file is used to load scripts. You can try to modify it to delay loading of Org Chart.

Note: that you will loose all modifications after next Org Chart update. This is not best practice approach to work with org chart.