【发布时间】:2015-07-09 05:30:13
【问题描述】:
我有一个store,它以dd-MM-yyyy 格式获取日期。我想在我的ExtJS grid 中对这个日期进行排序,这样同月的所有日期都应该一个接一个地显示,而下一个月份的日期应该显示。但正在发生的事情是,在ExtJS 中,所有日期都被视为字符串,所以我得到的输出为01-01-2015 下一个日期是01-02-2015,这是我不想要的。那么是否可以在 ExtJS 3.2 中进行自定义排序?
代码 sn-p:
var memebersListStore = new Ext.data.JsonStore({
name: 'approverlist',
autoLoad: true,
url: 'json/loginLogout.do?Uid=' + userLdapId + '&startDate=' + selectedStartDate + '&endDate=' + selectedEndDate,
fields: ['weekDate'],
sortInfo: {
field: 'weekDate',
direction: 'ASC'
},
listeners: {
load: function (store, records, options) {
if (store.getTotalCount() === 0) {
memebersListStoreGrid.reconfigure(store, columnsTwo);
} else {
memebersListStoreGrid.reconfigure(store, columnsOne);
}
}
}
});
有人知道吗?
【问题讨论】: