jQWidgets Forums

jQuery UI Widgets Forums Grid Switching the data source of a grid

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

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author

  • DM
    Participant

    Hi,

    I have an issue switching the data source of a grid. I need to change the source and the columns using the following calls:

    element.jqxGrid(‘source’, );
    element.jqxGrid(‘columns’, );

    …which works fine. The problem is that if the user is currently on page 3 (say) of the current source, when I switch to the new source they are left on page 3 rather than resetting to page 0. This can display an empty grid if there isn’t enough data to reach to page 3. If I add the gotopage command:

    element.jqxGrid(‘gotopage’, 0);

    …the page number is reset – but I’m now getting 2 calls to request the data – one for the initial source change and another for the gotopage. The data requests could become expensive so I don’t want to be making 2 calls for the same data.

    I’ve tried using beginupdate and endupdate but they seem to affect the rendering rather than the ajax requests to get the data in the first place.

    Is there a way of preventing ajax data requests while the grid is being reset?

    Thanks

    Switching the data source of a grid #22521

    Peter Stoev
    Keymaster

    Hi,

    Do you use jQWidgets 2.8.3? In the current version, when the “source” property is set, the “page number” is being reset, too.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.