【ExtJS】错误:this.config[...].width为空或不是对象
2012-12-20 11:34
381 查看
var grid = new Ext.grid.GridPanel({ store: store, columns: [ {id : 'company',header: 'Company', width: 160, sortable: true, dataIndex: 'company'}, {header: 'Price', width: 75, sortable: true, renderer: 'usMoney', dataIndex: 'price'}, {header: 'Change', width: 75, sortable: true, renderer: change, dataIndex: 'change'}, {header: '% Change', width: 75, sortable: true, renderer: pctChange, dataIndex: 'pctChange'}, {header: 'Last Updated', width: 85, sortable: true, renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'lastChange'} ], stripeRows: true, autoExpandColumn: 'company', height: 350, width: 600, title: 'Array Grid', // config options for stateful behavior stateful: true, stateId: 'grid' });
上面代码中红颜色hightlight的id去掉,刷新页面报:this.config[...].width为空或不是对象的错误。查看Ext API帮助文档,其中Column类中对id的解释中最后一句:
The Ext.grid.GridPanel.autoExpandColumn grid config option references the column via this unique identifier.
而GridPanel对autoExpandColumn的解释如下:
[b]autoExpandColumn [/b]: String
The id of a column in this grid that should expand to fill unused space. This value specified here can not be 0.
解决该问题的方法是:
1.恢复操作,即把id : 'company'添加回去。
2.把autoExpandColumn: 'company',去掉。
相关文章推荐
- Ext错误:this.config[...].width为空或不是对象
- Extjs报错:'this.config[...].width' 为空或不是对象
- javascript运行时错误:this.ds为空或不是对象
- Extjs报错,“this.config[…].width’解决方法
- 网页错误信息 'this.get_element().style' 为空或不是对象
- Extjs window弹出框 第二次打开时会报:【'addCls' 为空或不是对象】错误
- ExtJs中的 'insertAdjacentHTML' 为空或不是对象错误原因及解决办法
- Microsoft JScript 运行时错误: 'this.Columns' 为空或不是对象
- 错误消息:'events' 为空或不是对象
- extjs中 this 在某些情况下指的是哪个对象
- ASP.NET 创建母版页导致js出现“ 'document.getElementById(...)' 为空或不是对象”错误
- JavaScript 嵌套函数指向this对象错误的解决方法
- 错误消息:'events' 为空或不是对象
- FCKeditor出现"this connector is disabled Please check the"editor/filemanager/connectors/aspx/config.aspx"错误的解决办法【转】
- Highcharts控件使用说明及注意事项, 错误: 'Highcharts' 未定义 错误: 'jb' 为空或不是对象
- ExtJs中出现this.ds.fields.get(i) is undefined错误解决方法
- git错误:fatal: 不是一个有效的对象名:'master'。
- ExtJs4.0 getEditor() 为空或不是对象
- JavaScript 嵌套函数指向this对象错误的解决方法
- 错误消息:'events' 为空或不是对象