gpt4 book ai didi

javascript - ExtJS 5.0 : Grid remoteSort always sorts by the default 'sorters' only

转载 作者:行者123 更新时间:2023-11-30 15:05:14 30 4
gpt4 key购买 nike

我有一个带有缓冲存储的 EXTJS 网格。我在这家商店启用了 remoteSort: true。一些列被标记为可排序:真。但是每次我点击任何列进行排序时,进行的后端调用只包括商店中提到的排序列和方向。前任。即使我点击 Col2 或 Col3 进行排序,GET 调用后端始终包含“排序:col1,方向:desc”,如“排序器”中所述。

商店:

Ext.define('MyStore', {
extend: 'Ext.data.BufferedStore',
model : 'MyModel'

pageSize: 200,
autoLoad: false,
leadingBufferZone: 200,
trailingBufferZone: 200,
remoteSort: true,
sorters: [{
property: 'col1',
direction: 'DESC'
}],

proxy: {
type : 'rest',
format: 'json',
url : '/my_app/my_controller/list',
extraParams: {
someparam: '',
otherparam: ''
},
reader: {
type: 'json',
rootProperty: 'data',
totalProperty: 'totalCount'
}
}
});

网格:

Ext.define('MyPanel', {
extend: 'Ext.grid.Panel',
requires: [
'MyStore'
],
initComponent: function() {
this.store = new MyStore();
this.callParent(arguments);
},
columns: [{
text: 'Col1',
dataIndex: 'col1',
width: 150,
sortable: true
},{
text: 'Col3',
dataIndex: 'col3',
width: 150,
sortable: true
},{
text: 'Col3',
dataIndex: 'col3',
width: 250,
sortable: true
}]
});

我怎样才能让这个网格按点击的任何可排序列进行排序?

最佳答案

您已明确设置 simpleSortMode ,并且文档已经提到了问题所在。

您已经设置了第一个排序器,按列点击排序会在其后添加第二个排序器,但是当 simpleSortMode 被激活时,只有第一个排序器被发送到服务器。

关于javascript - ExtJS 5.0 : Grid remoteSort always sorts by the default 'sorters' only,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45869307/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com