我有一个网格,当我展开行时,在该网格中,还有另一组数据要显示。我希望那些网格列是动态的。根据我的 json 数据,我想将数据推送到列中。但是在这里当我给出方法时,调试器不会去那里。任何人都可以解释如何在 extJS 小部件列中加载动态列。这是我的代码Ext.define('myApp.view.base.grid.Window', { extend: 'Ext.window.Window', alias: 'widget.win', title: 'my window', height: 500, width: 800, layout: 'fit', items: [{ xtype: 'grid', columns: [{ text: 'Col 1', dataIndex: 'col1', flex: 1, },{ text: 'col2', dataIndex: 'col2', flex: 1 }], }], plugins: [{ ptype: 'rowwidget', widget: { xtype: 'grid', columns:[]//this.createColumn() // This columns i want to load dynamically. } }]});
1 回答
![?](http://img1.sycdn.imooc.com/54584f6d0001759002200220-100-100.jpg)
萧十郎
TA贡献1815条经验 获得超13个赞
要将列动态添加到插件中,您必须在插件列数组中推送列配置。
grid.getPlugin().config.widget.columns.push({
text : 'Item',
dataIndex : 'item',
flex : 1
}, {
text : 'Description',
dataIndex : 'desc',
flex : 2
});
在这里为您创建了一个小提琴
添加回答
举报
0/150
提交
取消