'expand all'和'collapse all'选项无法在rallytreegrid上工作

问题描述:

我想为rallytreegrid添加expand allcollapse all选项。 我使用的代码为https://help.rallydev.com/apps/2.1/doc/#!/example/simple-tree-grid,并添加了expandAllInColumnHeaderEnabled属性,其值为true。仍然expand allcollapse all选项不起作用。'expand all'和'collapse all'选项无法在rallytreegrid上工作

以下是更新后的代码:

<!DOCTYPE html> 
<html> 
<head> 
    <title>Simple Tree Grid Example</title> 

    <script type="text/javascript" src="/apps/2.1/sdk.js"></script> 

    <script type="text/javascript"> 
     Rally.onReady(function() { 
      Ext.define('Rally.example.SimpleTreeGrid', { 
       extend: 'Rally.app.App', 
       componentCls: 'app', 

       launch: function() { 
        Ext.create('Rally.data.wsapi.TreeStoreBuilder').build({ 
         models: ['userstory'], 
         autoLoad: true, 
         enableHierarchy: true 
        }).then({ 
         success: this._onStoreBuilt, 
         scope: this 
        }); 
       }, 

       _onStoreBuilt: function(store) { 
        this.add({ 
         xtype: 'rallytreegrid', 
         store: store, 
         context: this.getContext(), 
         enableEditing: false, 
         enableBulkEdit: false, 
         shouldShowRowActionsColumn: false, 
         expandAllInColumnHeaderEnabled: true, 
         enableRanking: false, 
         columnCfgs: [ 
          'Name', 
          'ScheduleState', 
          'Owner' 
         ] 
        }); 
       } 
      }); 


      Rally.launchApp('Rally.example.SimpleTreeGrid', { 
       name: 'Simple Tree Grid Example' 
      }); 
     }); 
    </script> 

    <style type="text/css"> 

    </style> 
</head> 
<body></body> 
</html> 

请帮助。提前致谢。

这有点奇怪。为了得到这个工作,你需要同时启用你已经找到的配置标志,并且在树形网格中添加一个插件:

plugins: [{ ptype: 'rallytreegridexpandedrowpersistence'}], 
expandAllInColumnHeaderEnabled: true