Rally-RallyGridBoard中的数据上下文和InlineFilter问题

时间:2018-09-17 16:40:24

标签: rally

目标: 试图构建一个Rally App,以根据从userSearchCombo框中选择的Project值填充“ PortFolioItem /功能”。

方法:  1.基于“项目”模型创建UserSearchComboBox。  2.根据从组合框中选择的值,基于“ PortfolioItem / Feature”模型创建TreeStore。

树存储的作用域范围基于从“项目搜索”组合框中选择的值

 app.portfoliotreeStore = Ext.create('Rally.data.wsapi.TreeStoreBuilder').build({
                    models: modelNames,
                    autoLoad: true,
                    enableHierarchy: true,
                    limit: 'Infinity',
                    remoteSort: true,
                    //        sorters: app.appSorters,
                    //fetch: ['Name', 'FormattedID', 'ScheduleState', 'PlanEstimate', 'Owner', 'Project'],
                    //filters: filters,
                    // filters: this.getQueryFilter(),
                    context: {
                        project: app.selProjectRef,
                        projectScopeDown: true
                    }

                }).then({
                    success: this._addGridboard,
                    failure: this.showErrorNotification,
                    scope: this
                });
  1. 在“添加网格板方法”中,创建了带有某些插件的gridBoard

     _addGridboard: function(store) {
                console.log("Entering _addGridBoard", store);
                app.portfoliotreeStore = store;
                var modelNames = ['portfolioitem/PPMFeature']
                var filters = app.getStoreFilters(app.selProjectName);
    
                console.log("the Grid", app.down('#gridContainer'));
                if (app.down('#gridContainer')) {
                    app.down('#gridContainer').remove('gridBoard');
                }
                //this.gridBoardConfig = app._getGridBoardConfig(store);
    
                var dataContext = app.getContext().getDataContext();
                console.log("DATA CONTEXT ::::", dataContext);
    
                gridStateString = this.statePrefix + "-treegrid";
                gridStateId = this.getContext().getScopedStateId(gridStateString);
                app.down('#gridContainer').add({
                    xtype: 'rallygridboard',
                    itemId: 'gridBoard',
                    //  context: this.getContext(),
                    modelNames: ['portfolioitem/PPMFeature'],
                    toggleState: 'grid',
                    plugins: [
    
                        'rallygridboardaddnew', {
                            ptype: 'rallygridboardinlinefiltercontrol',
                            inlineFilterButtonConfig: {
                                //stateful: true,
                                //stateId: this.getContext().getScopedStateId('filters-1'),
                                //collapsed: true,
                                context: this.getContext(),
                                modelNames: ['portfolioitem/PPMFeature'],
                                inlineFilterPanelConfig: {
    
                                    collapsed: true,
                                    quickFilterPanelConfig: {
                                        whiteListFields: [
                                            'Tags',
                                            'Milestones'
                                        ],
                                        defaultFields: [
                                            'ArtifactSearch',
                                            'Owner',
                                            'ModelType',
                                            'Milestones'
                                        ]
                                    }
    
                                }
                            }
                        },
    
                        {
                            ptype: 'rallygridboardfieldpicker',
                            headerPosition: 'left',
                            modelNames: this._getModelNames()
                                //stateful: true,
                                //stateId: this.getContext().getScopedStateId('columns-example')
                        }
    
                    ],
                    stateful: true,
                    listeners: {
                        'staterestore': {
                            fn: this._onGridStateRestore,
                            single: true
                        },
                        'load': {
                            fn: this._onGridload,
                            single: true
                        },
                        scope: this
    
    
    
                    },
    
                    gridConfig: {
                        store: store,
                        storeConfig: {
                            filters: this.getQueryFilter()
                        },
    
                        columnCfgs: [
                            'Name',
                            'Project',
                            'ScheduleState',
                            'Owner',
                            'PlanEstimate'
                        ]
    
                        // derivedColumns: this.getDerivedColumns()
                    },
    
                    /*
                    gridConfig: {
                        store: store,
                        storeConfig: {
                            filters: this.getQueryFilter()
                        },
    
                        columnCfgs: [
                            'Name',
                            'Project',
                            'ScheduleState',
                            'Owner',
                            'PlanEstimate'
                        ],
    
                        // derivedColumns: this.getDerivedColumns()
                    },
                    */
                    height: this.getHeight()
                });
    
            },
    
    1. 请注意以下几点
      • 不将任何上下文传递给网格组件-原因::如果我通过 “ this.getContext”到网格,重复记录最初被加载到 网格,一旦我单击任何标题以对网格进行排序,重复项就会消失。

问题:发现22种情况 我摆脱重复项的唯一方法是不将上下文传递给GridBoard,但这会影响我的插件-“ rallygridboardinlinefiltercontrol”

如果我在InlinefilterButton上滚动,则会引发此错误

   Uncaught TypeError: Cannot read property 'collapsed' of undefined
at constructor._onBeforeShowToolTip (VM556 sdk.js:100)
at constructor.fire (VM556 sdk.js:5)
at constructor.continueFireEvent (VM556 sdk.js:6)
at constructor.fireEventArgs (VM556 sdk.js:6)
at constructor.prototype.fireEventArgs (VM556 sdk.js:18)
at constructor.fireEvent (VM556 sdk.js:6)
at constructor.show (VM556 sdk.js:15)
at constructor.callParent (VM556 sdk.js:2)
at constructor.show (VM556 sdk.js:25)
at constructor.showFromDelay (VM556 sdk.js:25)

当我单击它时,它将引发此错误

   Uncaught TypeError: Cannot read property 'toggleCollapse' of undefined
at constructor._toggleFilterPanel (VM556 sdk.js:100)
at call (VM556 sdk.js:5)

它不会影响我的其他过滤器

1 个答案:

答案 0 :(得分:0)

好吧,我终于找到了问题...看来,我需要将Context传递给网格,但是我还需要将TreeGrid上的自动加载设置为false,这是因为该插件具有加载的责任商店..呀!尤里卡(Eureka)尤里卡(Eureaka)我知道了...任何人都可以在Rally上征集任何好书吗。