[急] ext 1.1 grid 刷新问题 我改变了data的值后 我想通过datastore的reload刷新grid的显示方法但是不成功
varjson=[["a","scpower","dazhou小角","县长","dazhou"],["b","scpower","dazhou小角","县长","daz...
var json =[["a","scpower","dazhou小角","县长","dazhou"],
["b","scpower","dazhou小角","县长","dazhou"],
["c","scpower","dazhou小角","县长","dazhou"],
["d","scpower","dazhou小角","县长","dazhou"]];
var cm= new Ext.grid.ColumnModel(
[{id:'id',header: 'ID', width: 50, dataIndex: 'id'},
{header: '权限类型', width: 90, dataIndex: 'type'},
{header: "权限名称", width: 140, dataIndex: 'name'},
{header: "作用", width: 90, dataIndex: 'value'},
{header: "所属模块", width: 120, dataIndex: 'belong'}]);
cm.defaultSortable = true;
this.ds = new Ext.data.Store({
proxy: new Ext.ux.data.PagingMemoryProxy(this.json),
reader: new Ext.data.ArrayReader({},
[{name:'id'},{name:'type'},{name: 'name'},{name: 'value'},{name: 'belong'}])
});
this.ds.load();
var grid = new Ext.grid.EditorGrid('grid', {
ds: this.ds,
cm: cm
// selModel: new Ext.grid.RowSelectionModel({singleSelect:false})
});
grid.addListener('rowdblclick', function(){rowdblclickFn});
grid.render();
},
rowdblclickFn:function(){
this.json=[["a","scpower","dazhou小角","县长","dazhou"],
["b","scpower","dazhou小角","县长","dazhou"],
["c","scpower","dazhou小角","县长","dazhou"]];
this.json=json;
this.ds.reload();
}
代码不一定能运行 但是大概意思是这个意思 就是要想个方法能购让以前grid的四条数据变成 新的3条其他数据 急 如果有疑问 没看懂问题 还可以直接加 QQ 252530600 展开
["b","scpower","dazhou小角","县长","dazhou"],
["c","scpower","dazhou小角","县长","dazhou"],
["d","scpower","dazhou小角","县长","dazhou"]];
var cm= new Ext.grid.ColumnModel(
[{id:'id',header: 'ID', width: 50, dataIndex: 'id'},
{header: '权限类型', width: 90, dataIndex: 'type'},
{header: "权限名称", width: 140, dataIndex: 'name'},
{header: "作用", width: 90, dataIndex: 'value'},
{header: "所属模块", width: 120, dataIndex: 'belong'}]);
cm.defaultSortable = true;
this.ds = new Ext.data.Store({
proxy: new Ext.ux.data.PagingMemoryProxy(this.json),
reader: new Ext.data.ArrayReader({},
[{name:'id'},{name:'type'},{name: 'name'},{name: 'value'},{name: 'belong'}])
});
this.ds.load();
var grid = new Ext.grid.EditorGrid('grid', {
ds: this.ds,
cm: cm
// selModel: new Ext.grid.RowSelectionModel({singleSelect:false})
});
grid.addListener('rowdblclick', function(){rowdblclickFn});
grid.render();
},
rowdblclickFn:function(){
this.json=[["a","scpower","dazhou小角","县长","dazhou"],
["b","scpower","dazhou小角","县长","dazhou"],
["c","scpower","dazhou小角","县长","dazhou"]];
this.json=json;
this.ds.reload();
}
代码不一定能运行 但是大概意思是这个意思 就是要想个方法能购让以前grid的四条数据变成 新的3条其他数据 急 如果有疑问 没看懂问题 还可以直接加 QQ 252530600 展开
3个回答
展开全部
this.json=json; == > json = this.json;
你在 rowdblclickFn:function() 函数中改变了 this.json的值 但你为何 有把
this.json = json;呢?
你在 rowdblclickFn:function() 函数中改变了 this.json的值 但你为何 有把
this.json = json;呢?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
代码不一定能运行 但是大概意思是这个意思 就是要让 reload()方法能购让以前grid的四条数据变成新的3条数据了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询