Grid / TreeGrid的过滤器控件

时间:2015-04-10 19:35:16

标签: rally

过滤器控制组件是否可用于Grid / TreeGrid(类似于“项目组合项”仪表板中的过滤器)?根据SDK 2.0文档,该组件似乎仅适用于GridBoard。

1 个答案:

答案 0 :(得分:0)

gridboard是treegrid或board的包装器,filtercontrol插件应该与TreeGrid一起使用。以下是enableHierarchy设置为true且rallygridboardcustomfiltercontrol插件的树网格示例:

Ext.define('CustomApp', {
    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) {
        var modelNames = ['userstory'];
        var context = this.getContext();
        this.add({
            xtype: 'rallygridboard',
            modelNames: modelNames,
            context:context,
            enableHierarchy: 'true',
            toggleState: 'grid',
            plugins: [
                {
                    ptype: 'rallygridboardcustomfiltercontrol',
                    filterControlConfig: {
                        modelNames: modelNames
                    }
                }
            ],
            cardBoardConfig: {
                attribute: 'ScheduleState'
            },
            gridConfig: {
                store: store,
                columnCfgs: [
                    'Name',
                    'ScheduleState',
                    'Owner',
                    'PlanEstimate'
                ]
            },
            height: this.getHeight()
        });
    }
});