2014-07-18 31 views
1

我有一个rowexpander,在每个rowexpander中,还有另一个行扩展器。但行内扩展器不扩展调用expandAllRows()extjs rowexpander里面的另一个rowexpander没有扩大

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

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

根据你如何构建网格,你至少可以使用这个概念并从那里开始。

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

//电网CONFIGS

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 
     } 
    } 
} 
相关问题