extjs列表怎么无法显示
Ext.onReady(function(){varcm=newExt.grid.ColumnModel([{header:'1',dataIndex:'id'},{he...
Ext.onReady(function(){
var cm=new Ext.grid.ColumnModel([
{header:'1',dataIndex:'id'},
{header:'2',dataIndex:'name'},
{header:'3',dataIndex:'desc'}]);
var data=[['1','n1','d1'],
['2','n2','d2'],
['3','n3','d3']];
var ds=Ext.data.Store({
proxy:new Ext.data.MemoryProxy(data),
reader:new Ext.data.ArrayReader({},[{name:'id'},{name:'name'},{name:'desc'}])});
ds.load();
var grid=new Ext.grid.GridPanel({
renderTo:Ext.getBody(),
ds:ds,
cm:cm,
width:300,
autoHeight:true
});
}); 展开
var cm=new Ext.grid.ColumnModel([
{header:'1',dataIndex:'id'},
{header:'2',dataIndex:'name'},
{header:'3',dataIndex:'desc'}]);
var data=[['1','n1','d1'],
['2','n2','d2'],
['3','n3','d3']];
var ds=Ext.data.Store({
proxy:new Ext.data.MemoryProxy(data),
reader:new Ext.data.ArrayReader({},[{name:'id'},{name:'name'},{name:'desc'}])});
ds.load();
var grid=new Ext.grid.GridPanel({
renderTo:Ext.getBody(),
ds:ds,
cm:cm,
width:300,
autoHeight:true
});
}); 展开
1个回答
展开全部
Ext.onReady(function() {
var ds = Ext.data.Store({
fields : [{
name : 'id'
}, {
name : 'name'
}, {
name : 'desc'
}],
data : [{
id : '1',
name : 'n1',
desc : 'd1'
}, {
id : '2',
name : 'n2',
desc : 'd2'
}, {
id : '3',
name : 'n3',
desc : 'd3'
}]
});
var grid = new Ext.grid.GridPanel({
renderTo : Ext.getBody(),
store : ds,
width : 300,
columns : [{
header : '1',
dataIndex : 'id'
}, {
header : '2',
dataIndex : 'name'
}, {
header : '3',
dataIndex : 'desc'
}]
});
});
我就不细说了,纠正并简约了一下你的代码。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询