I have some grids that have a refresh button on them, which re-loads the data on the grid from my server.
My refresh is a simple:
grid.clearAll();
grid.load(url);
I know I could put a grid.filterByAll() in my refresh function or onAfterLoad, but my filters are serverFilters, so that puts extra, unnecessary strain on the server (because it throw two requests to the server instead of just one).
Is there a way for filters to persist on reload (instead of using filterByAll())? So when I refreshed the grid it would re-load with the same filters applied?
integral, That’s a good solution on pages with disconnected grids–I’ll use it in some places.
However I have a number of interconnected datatables/tabs, so preserving the filter as part of the URL like how apin suggested works a bit better on most of my pages.
For example I have a page with 4 tabs and a grid under each tab. What data is loaded in each grid is somewhat determined by what the user does in another tab (i.e. clicks a state-> temperatures for cities in that state are loaded in a temperature tab). That needs to call a load with a URL and a posted variable, but I sometimes want to preserve the filter used in the temperature tab beforehand (i.e. user selects a state, temperatures for cities in that state are loaded in the 2nd tab, user wants to find temps that are >80, user goes back to state tab and selects a different state, the temperature tab loads the cities in the new state where temps are >80 on first load). It’s not possible to just filterByAll because of the changed postdata
I could user filterByAll() in onAfterLoad for the grids, but that causes two requests to be sent to my server, which is unnecessary extra load.
i’ve a peculiar requirement. i’ve millions of rows. so i’m bringing the filter options dynamically from server. i’m trying to bring the filter data as and when user types int the filterbox by capturing in the event: onTimedKeyPress.
i’m also using server side filtering/paging/sorting. i’m not using http get to filter data. i’m using a post method and sending some extra information along to get the filtered data. everthing works fine so far. but after parsing data into grid, i’m loosing filters state. not able to persist the filters. i’ve tried setState option. but the “onDataRequest” event is firing after the setState, and goes into infinite loop. can someone help me how to achieve this?