jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Initial filtering with new $.jqx.filter() and data loading
Tagged: beginupdate, endupdate, filter, grid, initial load, initialized, jqxgrid
This topic contains 3 replies, has 2 voices, and was last updated by Dimitar 11 years, 5 months ago.
-
Author
-
Hello !
I have successfully implemented initial filters on a grid, by putting something like this:
$myGrid.on('initialized', function() { // Initial applied filter [testing] var priorityFilter = new $.jqx.filter(); var prioF1 = priorityFilter.createfilter('stringfilter', '3.High', 'EQUAL'); priorityFilter.addfilter(1, prioF1); $("#issues-grid").jqxGrid('addfilter', '_priority', priorityFilter); $("#issues-grid").jqxGrid('applyfilters'); }
However, my grid uses remote data loaded from the server with a DataAdapter
The problem is that when the grid is created, the data is loaded twice from the server.
– First time without any filters
– Second time with that “priorityFilter” appliedGET http://localhost/issue/list?action=get_…index=25&custom%5Bmaxrows%5D=100&_=1383050848754 | 200 OK | 286ms
GET http://localhost/issue/list?action=get_…index=25&custom%5Bmaxrows%5D=100&_=1383050849418 | 200 OK | 236msThis happen one after another without me touching the filter row, probably first one when the grid is initialized, and the second one when the even “initalized” happens and filters are applied.
Also, the grid “flashes” when doing this, as it takes some time for the second request to return, in which time the grid is show without filters, then a second later it shows with filters on.
—
My question is:Is there ANY way to force the grid to NOT load data from the server, and only do a load using the API ?
This way, I can initialize the grid, maybe put some filters up, change the page, whatever… and at the end ask for a data load and display to the user.If not, can you please add such an option ?
Example: “autobind” – true/false
+
the “refresh” method which should cause another dataBind / grid load, but I can call that only after finishing setting up filtersOr maybe you could make another smarter way of setting this up.
Thanks !
Hello wavetrex,
Unfortunately, there is no way to directly load filtered data in the grid.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Welp…
No love for remotely loaded dataAny chance of planning this feature for some of the next updates ?
I’ve seen other threads in the past with people requesting something like this.
—
Or my suggestion, a way to temporarely disable the auto-reloading of data every time a filter is changed and do a dataBind() when all the parameters have been set/changed.Thanks !
P.S. I asked before a similar thing related to loading of grid state, which would also load the data twice, first in the default original state and again after a custom state has been loaded.
The ability to disable autoupdate/autobind would be wonderful in both cases !Hi wavetrex,
Please note that you can call multiple methods between beginupdate and endupdate and the grid will be refreshed only once, after endupdate, i.e.:
$('#jqxGrid').jqxGrid('beginupdate');// your methods$('#jqxGrid').jqxGrid('endupdate');
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.