jQWidgets Forums

jQuery UI Widgets Forums Grid Server Side With Saved Sorting and Filtering Info

This topic contains 12 replies, has 2 voices, and was last updated by  Peter Stoev 9 years, 6 months ago.

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

  • Sibeesh Venu
    Participant

    HI,
    I have created a custom server side grid. I have given user to save the filter and sort info so that it can be retained when the same user comes again. Now the problem is when I apply the sort information in the ready event I am getting the below error.

    $(openFrom + "#jqxgrid").jqxGrid('sortby', sessionStorage.getItem("GridSortColumn"), sortdirectionvalue);

    Uncaught Error: jqxGrid: The data is still loading. When the data binding is completed, the Grid raises the ‘bindingcomplete’ event. Call this function in the ‘bindingcomplete’ event handler.

    Please check this and help me. Thanks in advance.

    Kindest Regards
    Sibeesh Venu


    Sibeesh Venu
    Participant

    In normal grid it works fine, I am getting this issue only when I changed my grid to server side one. Any help is appreciated. Actually, the ready event fires after every grid related stuffs are over right?


    Sibeesh Venu
    Participant

    Update:

    Below is my ready event.

    ready: function () {
                    applyColumnFilter();
                    applyColumnSort();
                }

    I found out the problem, actually when I call the sorting function alone in the ready event it works, but when I call the same after filter function it throws error. So that the filter is getting applied but sorting is not working.


    Peter Stoev
    Keymaster

    Hi Sibeesh,

    The error is thrown on purpose by jqxGrid and it explains what happens. You try to update the Grid while it is in re-rendering mode and it is in re-rendering mode due to the reason that you apply a Server Filter which is ASYNC process. When the ASYNC process ends, you will be able to call methods or set properties of jqxGrid.

    Best Regards,
    Peter Stoev

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


    Sibeesh Venu
    Participant

    But the filter is already applied, and is there anyway to know whether the filter process is done or not, any events like that? So I can call sort function in that event. Please reply me. Thanks in advance.


    Sibeesh Venu
    Participant

    I changed my source object as follows, changed async to false, now it seems everything works fine.

    var source =
                          {
                              datafields: DataFields,
                              datatype: "json",
                              async:false,
                              url: '../Widget/GetDataForGrid/',
                              sort: function () {
                                  $("#jqxgrid").jqxGrid('updatebounddata', 'sort');
                              },
                              filter: function () {
                                  $("#jqxgrid").jqxGrid('updatebounddata', 'filter');
                              },
                              beforeprocessing: function (data) {
                              }
                          };

    Thank you


    Sibeesh Venu
    Participant

    Hi Peter,
    Since I have changed async:false , it seems the normal grid refreshing icons are not showing even when I clicked on sorting , filtering , page events. Can you please provide me any solution regarding this? Thanks in advance.

    Kindest Regards
    Sibeesh Venu


    Peter Stoev
    Keymaster

    Hi Sibeesh Venu,

    If icons are not showing this means that you probably have not included the CSS files or have included the CSS files but forgot the images folder inside jqwidgets/styles folder.

    Best Regards,
    Peter Stoev

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


    Sibeesh Venu
    Participant

    Thanks for your reply, when I change async to true, the loading image is showing. Like I said, the issue exists only if async is false in source object. Please check and help me.


    Sibeesh Venu
    Participant

    Hi,
    Any updates? Thanks in advance


    Peter Stoev
    Keymaster

    Hi Sibeesh Venu,

    What kind of updates? The error is raised by Design by jqxGrid due to the reason that you try to update the Grid while it is still updating.

    Best Regards,
    Peter Stoev

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


    Sibeesh Venu
    Participant

    Hi Peter Stoev,

    Thanks for your reply. I am getting this problem when I change async to false only. If I change it to true, the refresh button is coming perfectly. Please check.

    Kindest Regards
    Sibeesh Venu


    Peter Stoev
    Keymaster

    Hi Sibeesh Venu,

    Of course there is a difference whether it is ASYNC or not ASYNC.

    You call:

    applyColumnFilter();
    applyColumnSort();

    If it is async, then both operations run simultaneously and you get Error by design because the Grid cannot apply a filter and sort at the same time. If there is running Update process, the second update should be made when the first one has finished.

    If it is not async, first operation ends, then second begins and you don’t get Error.

    I would suggest you to check the examples and help tutorials on our website in order to learn how to use this widget on server side.

    Best Regards,
    Peter Stoev

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

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

You must be logged in to reply to this topic.