EXTJS动态获得数据的问题
各位帮我看看以下代码哪里出错了
function loadGrid()
{
var cm = new Ext.grid.ColumnModel([
{header:'编号',dataIndex:'id'},
{header:'用户名',dataIndex:'username', width:200},
{header:'角色',dataIndex:'role', width:200}
]);
var data=[
['1','name1','desn1'],
['2','name1','desn1'],
['3','name1','desn1'],
['4','name1','desn1'],
['5','name1','desn1']
];
var ds=new Ext.data.Store({
remoteSort:true,
// proxy:new Ext.data.MemoryProxy(data),
//这里哪里出错了???
proxy:new Ext.data.DataProxy{
url : 'userAction_add.action',
method: 'post'
},
reader:new Ext.data.ArrayReader({},[
{name:'id'},
{name:'username'},
{name:'role'}
]),
successProperty: 'success'
});
ds.load({
params:{start : 0,
limit : 4}
});
var grid=new Ext.grid.GridPanel({
renderTo:Ext.getBody(),
store: ds,
width:800,
height:600,
cm:cm,
bbar: new Ext.PagingToolbar({
pageSize: 4,
store: ds,
displayInfo: true,
beforePageText:"当前第",
afterPageText:"页,共{0}页",
lastText:"尾页",
nextText :"下一页",
prevText :"上一页",
firstText :"首页",
refreshText:"刷新页面",
displayMsg: '显示第{0} 条到{1} 条记录,一共{2} 条',
emptyMsg: "没有记录"
}),
tbar:[{text:"新增账号", handler:add_user},
{text:"修改账号", handler:edit_user},
{text:"删除账号", handler:del_user}]
});
return grid;
}
proxy:new Ext.data.DataProxy{
url : 'userAction_add.action',
method: 'post'
},
这里怎么出错了???
------解决方案--------------------