另一个rowexpander里面的extjs rowexpander没有扩展

时间:2014-07-18 08:16:55

标签: extjs

我有一个rowexpander,并且在每行expander中,还有另一个行扩展器。但是在rowexpanders内部没有扩展调用expandAllRows()

 Ext.each(partyPanels, function (partyPanel, index) {
            partyPanel.expand(true); // Expand the parties             
            partyPanel.grid.expander.expandAllRows(); // Expand all the rows of the grid
            partyPanel.grid.expander.grid.expander.expandAllRows();
        });

什么是解决方案?

1 个答案:

答案 0 :(得分:1)

如果每个嵌套网格(带有rowexpander)依赖于其父网格(使用rowexpander),则需要在网格afterrender事件侦听器之后将expandbody调用嵌套在另一个内部。这就是我必须要做的。基本上,您需要将参数传递给每个嵌套网格,因此这些参数将成为配置。然后在网格定义中,使用me.variableForRowExpander拉出这些变量,然后展开嵌套网格。

根据您构建网格的方式,您至少可以使用此概念并从那里开始。

Ext.define('App.view.MyGrid', {
    extend: 'Ext.grid.Panel',

//网格配置

listeners: {

    afterrender: function(grid) {

        var me = this;

        this.getView().on('expandbody',
            function(rowNode, record, expandbody) {

                // place logic to build another nested grid dynamically.
                // ideally rowexpander should be placed inside the grid definition, not when instantiating the grid

                // me.gridCustomVariable = variable necessary to build nested grid and nested rowexpander configuration
        }
    }
}
相关问题