jQWidgets Forums

jQuery UI Widgets Forums Chart sync method in chart and progress spin?

Tagged: 

This topic contains 10 replies, has 2 voices, and was last updated by  Peter Stoev 11 years, 2 months ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
  • sync method in chart and progress spin? #47333

    kingaru
    Participant

    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
    Igor

    sync method in chart and progress spin? #47339

    Peter Stoev
    Keymaster

    Hi Igor,

    jqxDataAdapter’s beforeSend callback is called before an Ajax call, the loadComplete is called after an Ajax call.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

    sync method in chart and progress spin? #47349

    kingaru
    Participant

    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
    Igor

    sync method in chart and progress spin? #47354

    Peter Stoev
    Keymaster

    Hi Igor,

    I suggest you to check whether your Ajax call is async or not. I can not think of another reason.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

    sync method in chart and progress spin? #47355

    kingaru
    Participant

    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
    Igor

    sync method in chart and progress spin? #47366

    Peter Stoev
    Keymaster

    Hi 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 Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

    sync method in chart and progress spin? #47429

    kingaru
    Participant

    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
    Igor

    sync method in chart and progress spin? #47430

    Peter Stoev
    Keymaster

    Hi kingaru,

    Why do not you create the Chart after the Data is loaded i.e in the dataAdpater’s loadComplete callback?

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

    sync method in chart and progress spin? #47498

    kingaru
    Participant

    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
    Igor

    sync method in chart and progress spin? #47499

    kingaru
    Participant

    I think I just found an answer … I should be passing records … right?

    Igor

    sync method in chart and progress spin? #47513

    Peter Stoev
    Keymaster

    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 Stoev

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 11 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic.