Help my grid’s remote sorting (remoteSort:true) is not working after moving to Extjs 4

It’s always the little things that seem to catch you by surprise! Here’s a new one that may pop up when migrating your application from extjs3 to extjs4, and it has to do with server side behavior, so it will not be apparent on the front end. It looks like remote sort which used to pass the parameters ‘sort’ and ‘dir’ to the server has been changed to pass the parameters in an array object with the name ‘sort’ just like this instead:

1 [{"property":"field_name","direction":"ASC"}]

If you would like to change the sort call to the same format as Extjs 3 in order to transfer your applications just set the following parameter, simpleSortMode:true, in the proxy of the store and it will revert to the ‘old’ way of passing the parameters.
My sample remotely sorted store

01 Remote_sort_store_example = new Ext.data.Store({
02     model: ‘Remote_sort_store_’,
03     remoteSort:true,
04     pageSize:50,
05     proxy: {
06       type: 'ajax',
07       actionMethods: {
08         create : 'POST',
09         read   : 'POST',
10         update : 'POST',
11         destroy: 'POST'
12       },
13       simpleSortMode:true,     
14       url: 'learnsomethings.com/somethings/',
15       reader: {
16         type: 'json',
17         root: 'data',
18         totalProperty: 'results'
19       }
20     },
21     autoLoad: false
22   });

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值