The following store definition is not sending the "sort" parameters when the request is being sent. Version of ExtJS is 6.5.3
Code:
Ext.define('MyApp.store.transMgrAcaTier1Store', {
extend: 'Ext.data.Store',
requires: [
'MyApp.model.transMgrAcaTier1Model',
'Ext.data.proxy.Ajax',
'Ext.data.reader.Json',
'Ext.util.Sorter'
],
constructor: function(cfg) {
var me = this;
cfg = cfg || {};
me.callParent([Ext.apply({
remoteSort: true,
storeId: 'transMgrAcaTier1Store',
model: 'MyApp.model.transMgrAcaTier1Model',
proxy: {
type: 'ajax',
reader: {
type: 'json',
rootProperty: 'data'
}
},
sorters: {
direction: 'DESC',
property: 'TransferTime'
}
}, cfg)]);
}
});
And the code generating the request
Code:
getTier1PayrollFiles: function(field) {
console.log("trigger get payroll type file list");
var store = field.getStore();
storeproxy = store.getProxy();
storeproxy.url = "../ACA/TransferService.aspx?method=GetTier1&WI=" + Ext.getCmp('cntTransferMgr').MenuID + "&UID=" + Ext.getCmp('cntTransferMgr').UID + "&companykey=" + field.getValue() + "&transfertypeid=1";
store.load();
// Comment to get changes made
},
Parameters being applied to the request include
Code:
- method:
GetTier1
- WI:
9503
- UID:
5SMTWXTKKB00XY8KAARGULDZSOKT8HAY1CRHSY7M
- companykey:
ACA002-000004
- transfertypeid:
1
- _dc:
1521583666736
- page:
1
- start:
0
- limit:
25
Now when reviewing parameters sent using ExtJS 4.2 (current production) parameters being sent are as follows:
Code:
_dc |
1521587490106 |
companykey |
ACA002-000005 |
limit |
50 |
method |
GetTier1 |
page |
1 |
sort |
[{"property":"TransferTime","direction":"DESC"}] |
start |
0 |
transfertypeid |
1 |
UID |
E5LYMR04Q42B2YK4LNCTFTDP2FJGQJIVRT2FJPFR |
WI |
9503 |
You can see the "sort" parameter is being sent with this request and is lacking in the ExtJS 6.5 request.
Current code is further developed using the latest version of Sencha Architect while the current production was developed using standard code editing.
Is there some setting missing in the new development stopping the "sort" property from being appended?
Per documentation found at (https://docs.sencha.com/extjs/6.5.1/...roxy.Rest.html) it states outright
Note that Rest proxy inherits from Ext.data.proxy.Ajax, which already injects all of the sorter, filter, group and paging options into the generated url. See the Ext.data.proxy.Ajax for more details.
So why is "sort" parameter not being sent while page, start and limit are being automatically appended?