Answer the question
In order to leave comments, you need to log in
ExtJS 4.1.1, JsonStore, extraParams, Grid with server-side pagination, how to set parameters in Store?
There is a report, a simple grid, set up server pagination, everything works fine. But...
The report data depends on the selected date (from the datefield), that is, I select a date, and a request is sent to the server with the (date) parameter in addition to (start, limit, page) and the required report is returned, but when I click on pagination, then it does not work correctly, because the parameter (date) is not passed.
The only solution is to somehow pass an additional parameter or something similar during the click. Or save the last selected date on the server, or ... there are many bad decisions :D
I think there are those who have encountered such a problem.
Thanks in advance.
Answer the question
In order to leave comments, you need to log in
fornit1917 thanks ))
I solved the problem in this way:
<code lang="javascript">
listeners: {
'beforeload': function (store, options) {
if (typeof Ext.ComponentQuery.query('toolbar[name=gridToolbar] datefield')[0] === 'undefined') {
var currDate = moment().format("D.M.YYYY");
store.proxy.extraParams.d1 = currDate;
store.proxy.extraParams.d2 = currDate;
}
else {
store.proxy.extraParams.d1 = selectedDate(0);
store.proxy.extraParams.d2 = selectedDate(1);
}
}
</code>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question