mobfigr Posted November 18, 2008 Report Posted November 18, 2008 Team, I seem to be having an issue using the SFX_SendUserCallback function in JS when there are multiple charts on the same page. I'm using ChartFX in a web part hosted in Sharepoint 2007. I've got 2 web parts on the same page that use this function. I'm able to send in a unique chart ID for each call but I can't seem to get data for the second chart on the page to work correctly. This is namely because the SFX_SendUserCallback is repeated twice on the page - Once for each chart. So my JavaScript is not calling the right SFX_SendUserCallback instance... Any idea how to get around this? Quote
Frank Posted November 19, 2008 Report Posted November 19, 2008 1) There should only one definition for SFX_SendUserCallback 2) SFX_SendUserCallback is asynchronous and you cannot make a second call untill the first one is completed. If you need to make two calles you have to "chain them", that is to set it up so that the second call gets initiated AFTER the first call returns from the server. For example:SFX_onCallbackReadyDelegate = function (context, result) { SFX_processing = false; SFX_SendUserCallback ('chart1',...); // Call the second time (for chart2) AFTER the first call is done. }; SFX_SendUserCallback ('chart1',...); Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.