我数据库里面查询到的是600多条数据,然后返回DataTableToJson格式是:
{"totalCount":677,"items":[{"ID":"00f3b49b-7396-441c-9ef6-7e58a9ec4d09","TYPEID":"2","CARD":"436742121549428911311","BANK":"f6acb4fc-dd75-4d6e-bdcf-c5fce335a913","EXWD":"49c25763-0780-417c-97c7-11f57912a5dc","LXMC":"人员","BANKMC":"建行金支行","EXWDMC":"","COMPANY":"","BANKNAME":"","AREACODE":"","AREANAME":""},{"ID":"00f3b49b-7396-441c-9ef6-7e58a9ec4d09","TYPEID":"2","CARD":"436742121549428911311","BANK":"f6acb4fc-dd75-4d6e-bdcf-c5fce335a913","EXWD":"49c25763-0780-417c-97c7-11f57912a5dc","LXMC":"人员","BANKMC":"建行金支行","EXWDMC":"","COMPANY":"","BANKNAME":"","AREACODE":"","AREANAME":""}]}
这样的。
js获取json:
var store = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
url: "ajax/Bank/SearchBankCardList.ashx"
}),
reader: new Ext.data.JsonReader(
{totalProperty: "totalCount", root: "items"},
[{name:"ID"},{name:"TYPEID"},{name:"CARD"},{name:"BANKMC"},{name:"LXMC"},{name:"BANK"},{name:"EXWD"},{name:"EXWDMC"},{name:"COMPANY"}
,{name:"BANKNAME"},{name:"AREACODE"},{name:"AREANAME"}]
),
listeners: {loadexception: function(){
error("数据加载错误,请稍候重试...");
}, load: function(s,records){}
}
});这样来获取json的,不知道我这格式对不对。总数是600多条我的页面上显示的(当前记录数:1-3 总记录数:3)而且上一页和下一页也不能按显示是灰色的无法翻页,如下图: