I am using pagingtoolbar from ExtJs, however it’s not working correctly. I have one grid that list all records, no problem, but when I want to paging a customized search result it’s just show the first page correctly, when I click to show the second page it’s come back to original url (show all records), but I want the store url still having the search url.
Original url: ‘historico-ocorrencia’
Search url: ‘historico-ocorrencia/search’
When I click in a button the following code is fired:
formSearch.submit({
url: 'historico-ocorrencia/search',
method: 'get',
params: {
dataInicial: time,
dataFinal: timeFinal
},
success: function(form, action) {
store.removeAll();
store.add(action.result.historicoOcorrencias);
},
});
But when I click in paging toolbar to display the second page the above code is not fired, because I am not clicking in a button search. I want a way to display all the following pages using the url ‘historico-ocorrencia/search’ and still pass the params.
Thanks, if you have any questions, ask me please.
you should change the form from having a submit button to a regular button and in that button’s handler do something like this:
The reason your current thing does not work is because your store is always requesting back to the server for every page and you have not done anything to change how it requests that data, so it will just do the request the same way it was doing it all along.