我有几个共享公共列的网格(问题不限于列,任何配置对象)。目前我正在做这样的事情:什么是一些重用配置部分的好方法?
//columns.js
var columns = {"reusable1": {...}, "reusable2": {...}};
//grid views
Ext.define('MyApp.view.Grid', {
columns: [
{text:'inline column1'},
columns.reusable1,
columns.reusable2,
{text:'inline column2'},
]
});
这干得不错,但是这将是更好的方法以类似的方式工作(而无需在每个配置一块创造独特xtype
,或修改CONFIGS constructor
或initComponent
)。我只是想能够像以前一样将misc可重用配置片段内联。