EXTJS 4 动态grid
2020-11-27 13:40
标签:des code ext c width get var grid=Ext.getCmp("GridPanel1"); grid.setStore( Ext.JSON.decode(response.responseText) ); } 自己下载json文件 setStore: function(msg) { //var cm = new Ext.grid.ColumnModel(msg.colName); }); 赋值 data fields columns EXTJS 4 动态grid,搜素材,soscw.com EXTJS 4 动态grid 标签:des code ext c width get 原文地址:http://www.cnblogs.com/cndavy/p/3708464.html
var store = grid.getStore();
Ext.Ajax.request({
url:"server/grid.json",
params:{},
success:function(response, option){
} );
if (Ext.getCmp("GridPanel1") !==
undefined) {
Ext.getCmp("GridPanel1").destroy();
}
if (Ext.getCmp("gridStore") !== undefined) {
Ext.getCmp("gridStore").remove();
}
var store = new
Ext.data.JsonStore({
id: "gridStore",
data:
msg.data,
fields: msg.fieldNames
});
var grid
= new Ext.grid.GridPanel({
id: "GridPanel1",
height: 240,
width: 750,
dock: ‘top‘,
region: ‘center‘,
autoScroll: true,
split:
true,
border: false,
columns: msg.colName,
store: store
grid.render("FirstPanel");
}