[code="java"] var store = new Ext.data.JsonStore({
url: "gridPanelController.do?method=getGridMap", //请求URL
storeId: "myStore", //store的id
root: "fenyeList", //对应数据集的JSON KEY
idProperty: "id", //主键的KEY
//autoLoad : true, //自动加载
totalProperty: "fenyeCount",
//配置与返回的JSON数据的映射 name为store对应的 key mapping为返回JSON数据的KEY
fields : [
{name: 'fid', mapping: 'id'},
{name: 'fname', mapping: 'name'},
{name: 'fsalary', mapping: 'salary'},
{name: 'fcreateDate', mapping: 'createDate'}
]
});[/code]
上边写的再girdPanel中加载没问题。可以显示出数据,但是下面的写法就显示不出数据不知道为什么
[code="java"] var store = new Ext.data.JsonStore({
url: "gridPanelController.do?method=getGridMap", //请求URL
reader : new Ext.data.JsonReader({
storeId: "myStore", //store的id
root: "fenyeList", //对应数据集的JSON KEY
idProperty: "id", //主键的KEY
//autoLoad : true, //自动加载
totalProperty: "fenyeCount",
//配置与返回的JSON数据的映射 name为store对应的 key mapping为返回JSON数据的KEY
fields : [
{name: 'fid', mapping: 'id'},
{name: 'fname', mapping: 'name'},
{name: 'fsalary', mapping: 'salary'},
{name: 'fcreateDate', mapping: 'createDate'}
]
})
});[/code]