'扩展所有'并且'崩溃所有'选项不在rallytreegrid上工作

时间:2017-04-27 06:34:25

标签: rally

我想在rallytreegrid中添加expand allcollapse all选项。 我使用https://help.rallydev.com/apps/2.1/doc/#!/example/simple-tree-grid处的代码添加了expandAllInColumnHeaderEnabled属性,其值为true。仍有expand 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>

请帮忙。提前谢谢。

1 个答案:

答案 0 :(得分:0)

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

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