'expand all' 和 'collapse all' 选项不适用于 rallytreegrid

'expand all' and 'collapse all' option not working on rallytreegrid

我想将 expand allcollapse all 选项添加到 rallytreegrid。 我使用了 https://help.rallydev.com/apps/2.1/doc/#!/example/simple-tree-grid 处的代码并添加了 expandAllInColumnHeaderEnabled 属性,值为 trueexpand allcollapse all 选项仍然无效。

更新后的代码如下:

<!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>

请帮忙。提前致谢。

这有点奇怪。为了让它工作,你需要启用你已经找到的配置标志,并向 treegrid 添加一个插件:

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