Extjs 基于为纸板选择的PortfolioItem的过滤卡

Extjs 基于为纸板选择的PortfolioItem的过滤卡,extjs,rally,extjs4.2,Extjs,Rally,Extjs4.2,我正在创建一个rally sdk2应用程序,它显示rally.ui.dialog.ChooserDialog,其中包含MMF、Epic和Program等组合项目 当选择了多个MMF、EPIC或程序时,显示基于这些过滤器的功能,但卡无法获得。有些事我搞不懂。 下面是我的一些代码 Ext.define('CustomApp', { extend: 'Rally.app.App', componentCls: 'app',

我正在创建一个rally sdk2应用程序,它显示rally.ui.dialog.ChooserDialog,其中包含MMF、Epic和Program等组合项目 当选择了多个MMF、EPIC或程序时,显示基于这些过滤器的功能,但卡无法获得。有些事我搞不懂。 下面是我的一些代码

        Ext.define('CustomApp', {
            extend: 'Rally.app.App',
            componentCls: 'app',
            items:[{ xtype: 'container', itemId: 'filter_box', padding: 5},{xtype:'container',itemId:'button_box',layout:{type:'hbox'}, padding: 10}],              
            logger: new Rally.technicalservices.logger(),
            launch: function() {
                this.down('#button_box').add({
                    xtype: 'rallybutton',
                    text: 'Filter',
                    itemId: 'run-button',
                    scope: this,
                    handler: this._run,
                    margin: '0 10 0 95'
                });

            },
            _drawCardBoard: function(records){
                var filters = null;
                alert("hi there");
                console.log("context");
                var me = this;
                if (records[0].data.PortfolioItemTypeName == "MMF") {
                    console.log("context name", records[0].data.FormattedID);
                    filters = Ext.create('Rally.data.QueryFilter',{
                        property: 'Parent.FormattedID',
                        operator: '=',
                        value: records[0].data.FormattedID
                    });
                } else if (records[0].data.PortfolioItemTypeName == "Epic") {
                    filters = Ext.create('Rally.data.QueryFilter',{
                        property: 'Parent.Parent.FormattedID',
                        operator: '=',
                        value: records[0].data.FormattedID
                    }); 
                } else if (records[0].data.PortfolioItemTypeName == "Program") {
                    filters = Ext.create('Rally.data.QueryFilter',{
                        property: 'Parent.Parent.Parent.FormattedID',
                        operator: '=',
                        value: records[0].data.FormattedID
                    });                     
                }   
                if (records.length > 1) {
                    for ( var i=1;i<records.length;i++ ) {
                        if (records[i].data.PortfolioItemTypeName == "MMF") {
                            console.log("context name 2", records[i].data.FormattedID);
                            filters = filters.or(Ext.create('Rally.data.QueryFilter',{
                                property: 'Parent.FormattedID',
                                operator: '=',
                                value: records[i].data.FormattedID
                            }));
                        } else if (records[i].data.PortfolioItemTypeName == "Epic") {   
                            filters = filters.or(Ext.create('Rally.data.QueryFilter',{
                                property: 'Parent.Parent.FormattedID',
                                operator: '=',
                                value: records[i].data.FormattedID
                            }));                                
                        } else if (records[i].data.PortfolioItemTypeName == "Program") {    
                            filters = filters.or(Ext.create('Rally.data.QueryFilter',{
                                property: 'Parent.Parent.Parent.FormattedID',
                                operator: '=',
                                value: records[i].data.FormattedID
                            }));    
                        }       
                    }
                }   
                console.log("filters values", filters.toString());
                this.cardboard = Ext.create('Rally.ui.cardboard.CardBoard',{
                    types: ['PortfolioItem/Feature'],
                    attribute: 'Release',
                    columnConfig: {
                        xtype: 'rallycardboardcolumn',
                        displayField: 'Name',
                        valueField: '_ref',
                        plugins: [
                            {ptype:'rallycolumndropcontroller'},
                            {ptype:'rallycardboardcardrecordprocessor'},
                            {ptype:'tscolumnheaderupdater'}  /*,
                            {ptype:'tscolumnheaderupdater', field_to_aggregate: 'LeafStoryPlanEstimateTotal'}*/
                        ],
                    },
                    storeConfig: { 
                        filters: filters,
                        context: this.getContext().getDataContext()
                    },                              
                    cardConfig: {
                        showIconsAndHighlightBorder: false,                      
                        fields: [
                            'FormattedID',
                            'Name',
                            'Parent',
                            'ReleaseDate',
                            'ReleaseStartDate',
                            { name: 'Project', renderer: me._renderProject },
                            { name: 'PercentDoneByStoryPlanEstimate' },
                            { name: 'c_FeatureEstimate', fetch: ['c_FeatureEstimate'] }
                        ],
                        listeners: {
                            added: function(card,container){
                                me.logger.log(this,card,container);
                            },
                            fieldClick: function(eOpts) {
                                me.logger.log(this,eOpts);
                                if ( eOpts == "PercentDoneByStoryPlanEstimate" ) {
                                    me._showDoneTooltip(eOpts,this);
                                }
                            }
                        }
                    }
                });
                _run: function() {
                    this._parents = {};
                    var me = this;
                    Ext.create('Rally.ui.dialog.ChooserDialog', {
                        width: 470,
                        autoScroll: true,
                        height: 500,
                        title: 'Select to Filter',
                        pageSize: 100,
                        closable: false,
                        selectionButtonText: 'Filter',   
                        multiple: true, 
                        artifactTypes: ['PortfolioItem/MMF','PortfolioItem/Epic', 'PortfolioItem/Program'],
                        autoShow: true,
                        storeConfig:{
                            fetch: ['Name','PortfolioItemTypeName', 'Parent']
                        },
                        listeners: {
                            scope: me,
                            artifactChosen: function(selectedRecord) {
                                console.log("selectedRecord", selectedRecord);
                                me._drawCardBoard(selectedRecord);
                            }
                        }
                    });
                },                  
Ext.define('CustomApp'{
扩展:“Rally.app.app”,
组件CLS:“应用程序”,
项目:[{xtype:'container',itemId:'filter_box',padding:5},{xtype:'container',itemId:'button_box',布局:{type:'hbox',padding:10}],
logger:new Rally.technicalservices.logger(),
启动:函数(){
此.down(“#按钮_框”)。添加({
xtype:“拉力按钮”,
文本:“过滤器”,
itemId:“运行按钮”,
范围:本,,
处理程序:这个,
边距:“01095”
});
},
_抽芯纸板:功能(记录){
var过滤器=null;
警惕(“你好”);
console.log(“上下文”);
var me=这个;
if(记录[0].data.PortfolioItemTypeName==“MMF”){
console.log(“上下文名称”,记录[0]。data.FormattedID);
filters=Ext.create('Rally.data.QueryFilter'{
属性:“Parent.FormattedID”,
运算符:'=',
值:记录[0]。data.FormattedID
});
}else if(记录[0].data.PortfolioItemTypeName==“Epic”){
filters=Ext.create('Rally.data.QueryFilter'{
属性:“Parent.Parent.FormattedID”,
运算符:'=',
值:记录[0]。data.FormattedID
}); 
}else if(记录[0].data.PortfolioItemTypeName==“程序”){
filters=Ext.create('Rally.data.QueryFilter'{
属性:“Parent.Parent.Parent.FormattedID”,
运算符:'=',
值:记录[0]。data.FormattedID
});                     
}   
如果(记录长度>1){

对于(var i=1;iThanks all,我自己修复了它。我在过滤器中更改了'filters=Ext.create('Rally.data.QueryFilter',{property:'Parent',operator:'=',value:records[0].get('u ref'))`