将儿童故事添加到EPIC故事纸板中

时间:2015-05-05 22:49:04

标签: rally

我创建了一个使用Rally App SDK按目标版本过滤的EPIC故事板。我想为董事会中的每个史诗故事显示儿童故事信息(格式化ID和姓名),我不知道该怎么做。有人知道一种简单的方法将其添加到每张卡片中吗?请参阅下面的代码:

            _onLoad: function() {
                this.add({
                    xtype: 'rallycardboard',
                    types: ['User Story'],
                    attribute: 'ScheduleState',
                    readOnly: true,
                    context: this.getContext(),
                    cardConfig: {
                        editable: false,
                        showIconsAndHighlightBorder: false,
                        fields: ['Name', 'TestCases', 'c_StoryType', 'Children', 'c_TargetRelease', 'PlanEstimate']
                    },
                    storeConfig: {
                        filters: [
                            {
                                property: 'c_StoryType',
                                value: 'SAGA Feature'
                            },
                            {
                                property: 'c_TargetRelease',
                                operator: '=',
                                value: this.down('rallyfieldvaluecombobox').getValue()
                            }
                        ]
                    }
                });
            },

            _onSelect: function() {
                var board = this.down('rallycardboard');
                board.refresh({
                    storeConfig: {
                        filters: [
                            {
                                property: 'c_StoryType',
                                value: 'SAGA Feature'
                            },
                            {
                                property: 'c_TargetRelease',
                                operator: '=',
                                value: this.down('rallyfieldvaluecombobox').getValue()
                            }
                        ]
                    }
                });
            }, 

1 个答案:

答案 0 :(得分:0)

您可以通过在cardConfig

中指定要在卡片上显示的内容来实现此目的
cardConfig: {   
    fields: [
        'Name', 
        'TestCases', 
        'c_StoryType', 
        'Children', 
        'c_TargetRelease', 
        'PlanEstimate'  
        { name: 'Children', renderer: this._renderChildStories },
    ],
}   

然后定义_renderChildStories函数, 我的事物value将是儿童故事的集合,因此您可以根据val

来循环播放
_renderChildStories: function(val) {
    var store = Ext.create('Rally.data.custom.Store',{
        data: [
            {
                'FormattedID': val.get('FormattedID'),
                'Name': val.get('Name')
            }
        ]
    });
    return store
}   
相关问题