Ext.data.Store 4.0 排序
数据:
{ "success": true, "error": "", "singleInfo": "", "totalCount": 29, "data": [ { "ID": 1777, "Title": "星期一 (2013-05-27)" }, { "ID": 1764, "Title": "星期日 (2013-04-28)" }, { "ID": 1278, "Title": "星期四 (2012-12-20)" }, { "ID": 1280, "Title": "星期三 (2012-12-19)" }, { "ID": 1288, "Title": "星期二 (2012-12-18)" }, { "ID": 1285, "Title": "星期一 (2012-12-17)" }, { "ID": 1211, "Title": "星期四 (2012-12-13)" }, { "ID": 1189, "Title": "星期三 (2012-12-12)" }, { "ID": 1187, "Title": "星期二 (2012-12-11)" }, { "ID": 1158, "Title": "星期一 (2012-12-10)" }, { "ID": 1126, "Title": "星期五 (2012-12-07)" }, { "ID": 1120, "Title": "星期四 (2012-12-06)" }, { "ID": 1065, "Title": "11-21至11-28工作总结" }, { "ID": 1006, "Title": "星期二 (2012-11-20)" }, { "ID": 1004, "Title": "星期一 (2012-11-19)" }, { "ID": 932, "Title": "星期三 (2012-11-14)" }, { "ID": 931, "Title": "星期一 (2012-11-12)" }, { "ID": 859, "Title": "星期四 (2012-11-08)" }, { "ID": 858, "Title": "星期二 (2012-11-06)" }, { "ID": 753, "Title": "星期一 (2012-10-29)" }, { "ID": 674, "Title": "星期二 (2012-10-23)" }, { "ID": 662, "Title": "星期一 (2012-10-22)" }, { "ID": 538, "Title": "星期四 (2012-10-11)" }, { "ID": 537, "Title": "星期三 (2012-10-10)" }, { "ID": 354, "Title": "星期二 (2012-09-11)" }, { "ID": 353, "Title": "0904-0906周总结" }, { "ID": 288, "Title": "星期一 (2012-09-03)" }, { "ID": 176, "Title": "周总结(0806-0810)" }, { "ID": 31, "Title": "周总结" } ] }
Ext.create("Ext.data.Store", {
fields: ["ID", "Title"],
storeId: "ID",
// groupField: "ID",
// groupDir: "DESC",
sorters: { property: 'ID', direction: 'DESC' },
autoLoad: true,
pageSize: 8,
proxy: {
type: 'ajax',
url: '../../Command.aspx?FileName=Mobile&ClassName=Mobile.App_Code.WorkSum&MethodName=SumList',
reader: {
type: "json",
messageProperty: "error",
rootProperty: "data",
successProperty: "success",
totalProperty: "totalCount"
}
}
});