刚学习extjs,将ext API中的examples中的代码打打练练手。关于form中的例子都能正常运行,可关于grid中的例子就运行不起来。用firefox调试总出现this.el is null的错误、这是例子代码
Ext.onReady(function(){
var propsGrid = new Ext.grid.PropertyGrid({
el:'props-grid',
nameText: 'Properties Grid',
width:300,
autoHeight:true,
viewConfig : {
forceFit:true,
scrollOffset:2 // the grid will never have scrollbars
}
});
propsGrid.render();
propsGrid.setSource({
"(name)": "Properties Grid",
"grouping": false,
"autoFitColumns": true,
"productionQuality": false,
"created": new Date(Date.parse('10/15/2006')),
"tested": false,
"version": .01,
"borderWidth": 1
});
});
Ext.onReady(function(){
var propsGrid = new Ext.grid.PropertyGrid({
el:'props-grid',
nameText: 'Properties Grid',
width:300,
autoHeight:true,
viewConfig : {
forceFit:true,
scrollOffset:2 // the grid will never have scrollbars
}
});
propsGrid.render();
propsGrid.setSource({
"(name)": "Properties Grid",
"grouping": false,
"autoFitColumns": true,
"productionQuality": false,
"created": new Date(Date.parse('10/15/2006')),
"tested": false,
"version": .01,
"borderWidth": 1
});
});
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货