jQWidgets Forums

jQuery UI Widgets Forums Grid Cannot use 'loadstate' method with server-side filtering

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

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

  • aoverton07
    Participant

    You cannot use the loadstate method in conjunction with server-side filtering due to the fact that when the loadstate applies it’s filters, it get’s disrupted because the filter callback is called in the middle of the loadstate, triggering the updatebounddata method, something like this:

               var source =
                {
                    datatype: "jsonp",
                    datafields: [
                        { name: 'countryName', type: 'string' },
                        { name: 'name', type: 'string' },
                        { name: 'population', type: 'float' },
                        { name: 'continentCode', type: 'string' }
                    ],
                    url: "http://api.geonames.org/searchJSON",
                    filter: function () {
                        // update the grid and send a request to the server.
                        $("#jqxgrid").jqxGrid('updatebounddata');
                    }
                };

    You can see how the loadstate would trigger the above filter callback, causing the updatebounddata method to be called in the middle of the loadstate routine, what happens is that you get an error and the filterrow becomes invisible….any advice on how to work around this?

    I have setup a jsfiddle using your examples to demonstrate this behavior:

    http://jsfiddle.net/nyPsV/9/


    aoverton07
    Participant

    Am I forced to use custom filter/sort bindings and remove and replace them any time I want to use the loadstate method?


    Peter Stoev
    Keymaster

    Hi aoverton07,

    The sample that you point out does not implement Server Filtering. It makes Ajax request to somewhere. Server Filtering includes implementation of the Virtual Mode as well. Example: http://jsfiddle.net/kS79Z/

    Best Regards,
    Peter Stoev

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

You must be logged in to reply to this topic.