1
votes

I have a sharepoint page, generated from Dashboard Designer, with some scorecard webparts. In Sharepoint 2010, they are loaded and refreshed with ajax. How can I capture when a scorecard is fully loaded or refreshed? I have some jquery that cannot execute until the scorecards are fully loaded. But I dont know where to place an onload event, for example, or how to capture the ajax success callback.

Thanks very much.

2

2 Answers

3
votes

To accomplish a similar goal I used this approach:

var prm = Sys.WebForms.PageRequestManager.getInstance();    
prm.add_initializeRequest(InitializeRequest);
prm.add_endRequest(EndRequest);

function InitializeRequest(sender, args) {      
}

function EndRequest(sender, args) {

$(document).ready
(
 function()
 {
 alert("Did it work?");
 }
);
}

Look here for more details: http://msdn.microsoft.com/en-us/library/bb383810.aspx

Similar question answered here first: Attach event to hyperlink click inside update panel?

This should get you started. You may want to throw in a couple alerts to make sure you know how often the page is sending/receiving data via AJAX. It's possible you may need to target this more specifically to keep your Javascript from executing from some other AJAX thing happening on the page. I'm guessing you've moved beyond this long ago, but figured I'd try to answer it anyway. GL.

0
votes

You can deteremine if all the webparts are loaded. Here's a link! to provide a solution.