jQWidgets Forums
jQuery UI Widgets › Forums › Chart › sync method in chart and progress spin?
Tagged: chart spinner
This topic contains 10 replies, has 2 voices, and was last updated by Peter Stoev 11 years, 2 months ago.
-
Author
-
Hello,
After enabling of the “sync” method in the “dataAdapter” for my chart I’m facing a different type of the issue. Because of significantly large volume of data that I read from DB I want to display a “spinner” that would be indicating the data load process before the chart is displayed. Unfortunately “sync” method prevents DOM from updates so even I try to activate the spinner as a function just before calling “jxwChart” the spinner appears on the screen at the same time as chart and not before (since DOM is blocked).
I also was trying to utilize $(document).ajaxStart/.ajaxStop or inserting function in to beforeSend()/loadComplete() to enable/disable spinner on start/complete of AJAX sessions but it does not work either
Could you please advice me where would be the appropriate location for the start/stop functions to start/stop spinner in my particular case?Thanks in advance
IgorHi Igor,
jqxDataAdapter’s beforeSend callback is called before an Ajax call, the loadComplete is called after an Ajax call.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Hello Peter,
Thanks for the prompt feedback. I tried to use beforeSend callback to start spinner and loadComplete to stop it … unfortunately the spinner only appears after the Ajax is completed i.e. together with the chart. Am I doing something wrong here?
Regards
IgorHi Igor,
I suggest you to check whether your Ajax call is async or not. I can not think of another reason.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Hi Peter,
Like I’ve mentioned in my original post the call is sync because of the issue that I have described in my previous post (http://www.jqwidgets.com/community/topic/sync-method-in-chart-and-progress-spin/) which I resolved by enabling sync request. Please advice if there could be a different solution to that issue other than enabling sync which would resolve this particular problem.
Regards
IgorHi Igor,
You cannot have a Spinner in a Sync request, because the GUI will not perform anything until your request is Done.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Hello Peter,
Yes, I understood already that spinner will not be possible with sync. I would of course prefer to go with async option instead but having following challenge:
In order to define proper scale for my chart’s grid I need to assign variable values to “unitInterval:” which I receive via dataAdapter from a database. Unfortunately it looks like the chart creates axes before load of the dataAdapter is fully completed therefore the variable which I try to get from dataAdapter and pass to unitInterval is not available at the time when Axes/grid info for the chart are created. Could you please let me know if there is a solution to ful fil this requirements?
Thanks in advance
IgorHi kingaru,
Why do not you create the Chart after the Data is loaded i.e in the dataAdpater’s loadComplete callback?
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Hi Peter,
So you are suggesting to load dataAdapter via dataBind() and then in the loadComplete callback define settings for the chart and eventually call jqxChart(settings), right? What in that case should I pass as a “source:” in the chart settings? Please correct me if I’m wrong but if I’ll define the same dataAdapter as the source then we will have constant loop trough loadComplete callback -> jqxChart pointing to the dataAdapter trough the source -> dataAdapter -> loadComplete etc., or I’m missing something here?
Thanks
IgorI think I just found an answer … I should be passing records … right?
Igor
Hi Igor,
In the loadComplete, you can create another dataAdapter using the already Loaded Records from the first one and yes, the dataAdapter’s records are stored in its “records” member.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.