Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Extjs 是否需要在.js文件中重复列定义(对于网格)?_Extjs - Fatal编程技术网

Extjs 是否需要在.js文件中重复列定义(对于网格)?

Extjs 是否需要在.js文件中重复列定义(对于网格)?,extjs,Extjs,在extsjsdesigner中,假设创建了一个网格。因此它生成了两个js文件:SomeGrid.ui.js和SomeGrid.js。 ui.js文件具有列定义,js文件具有事件处理代码。 现在,如果在js文件中,我希望添加一个Rowwnumber,如下所示: initComponent: function() { SomeGrid.superclass.initComponent.call(this); this.colModel= new Ext.grid.ColumnModel({ col

在extsjsdesigner中,假设创建了一个网格。因此它生成了两个js文件:SomeGrid.ui.js和SomeGrid.js。 ui.js文件具有列定义,js文件具有事件处理代码。 现在,如果在js文件中,我希望添加一个Rowwnumber,如下所示:

initComponent: function() {
SomeGrid.superclass.initComponent.call(this);
this.colModel= new Ext.grid.ColumnModel({
columns: [
new Ext.ux.Plugins.PagingRowNumberer({width:30})
]
     }
         )
}
是否需要重新添加ui.js中指定的所有列定义?使用这段代码,它将页面jsut加载为一列:rowwnumber。
现有代码重新添加了所有列,但可能有更好的方法?

根据推荐的约定,列模型应该是.ui.js文件的一部分,而不是.js文件的一部分。 所以理想情况下,PaginGrowNumber列定义应该是SomeGrid.ui.js文件的一部分


如果由于某种原因不可能这样做,那么您必须重复SomeGrid.js文件中的所有列定义,因为一旦您这样做了。colModel=new Ext.grid.ColumnModel。。。在SomeGrid.js中,您正在有效地覆盖SomeGrid.ui.js中配置的ColumnModel,

hm…以java风格扩展..我们可以保留原始类的属性..有趣的是,这里没有发生这种情况不,它不是原始类的属性。它是一个嵌套属性。将其视为一个属性的最终属性。