View Full Version : grid hook on reload, resort. How?

11 Oct 2012, 4:30 AM

I am doing a paging remotely with bbar. And having some input fields to filter result. It is all good until user click on my search button. But the problem comes once user clicking on column headers to sort again, or by clicking reload at the paging toolbar. How can I hook over column head clicks (reorder), or even the reload icon on paging toolbar? I would like always include all my search criteria fields attached to query. I cannot find where to ingest this logic, or what method to overwrite...

thank you

11 Oct 2012, 8:06 AM
You can use the beforeload event of the store to maintain your search:

listeners: {
beforeload: function(){
var searchValue = toolbar.down('#search-field').value;
store.getProxy().extraParams = {}; // clear all previous
store.getProxy().extraParams.search = searchValue; // update persistent param