拉力赛:定制拉力赛网格任务板

时间:2015-06-25 03:49:00

标签: header grid task edit rally

我使用以下源代码创建了一个拉力赛任务板应用程序:https://github.com/RallyApps/app-catalog/tree/master/src/apps/taskboard

这是我的rallycardboard配置:

{
            xtype: 'rallycardboard',
            attribute: 'State',
            rowConfig: {
                field: 'WorkProduct',
                sorters: [
                    {
                        property: this._getRankField(),
                        direction: 'ASC'
                    },
                    {
                        property: 'TaskIndex',
                        direction: 'ASC'
                    }
                ],
                headerConfig: {
                    xtype: 'rallytaskboardrowheader'
                },
                columns:[{
                    columnConfig: {
                        xtype: 'rallycardboardcolumn'
                    },
                    fields: ['Release', 'PlanEstimate']
                }],
                sortField: this._getRankField(),
                enableCrossRowDragging: false
            },
            cardConfig: {
                editable: true,
                fields: ['Actuals'],
                skipDefaultFields: false
            },
            margin: '10px 0 0 0',
            plugins: [{ptype:'rallyfixedheadercardboard'}]
        };

对我来说有两个问题:

  1. 在cardConfig部分中,我为Actuals字段设置了可见性,但它只有在有值时才可见,如果它为null则不显示。我想表明即使它没有价值。

  2. 在headerConfig部分,我使用rallytaskboardrowheader,这是它的代码:

    {Ext.define('Rally.apps.taskboard.TaskBoardHeader',{     extend:'Rally.ui.cardboard.row.Header',     别名:'widget.rallytaskboardrowheader',

    requires: [
        'Ext.util.DelayedTask',
        'Rally.ui.popover.PopoverFactory'
    ],
    
    mixins: {
        clientMetrics: 'Rally.clientmetrics.ClientMetricsRecordable'
    },
    
    initComponent: function() {
        this.callParent(arguments);
        this._delayedTask = Ext.create('Ext.util.DelayedTask', this._showPopover, this);
        this.on('afterrender', function() {
            this.getEl().on('mouseover', this._onMouseOver, this, {delegate: '.formatted-id-link'});
            this.getEl().on('mouseout', this._onMouseOut, this, {delegate: '.formatted-id-link'});
        }, this, {single: true});
    },
    
    _onMouseOver: function() {
        this._delayedTask.delay(500, null, null);
    },
    
    _onMouseOut: function() {
        this._delayedTask.cancel();
    },
    
    _showPopover: function() {
        this.recordAction({description: 'showing work product popover on task board'});
    
        if (!Ext.getElementById('work-product-popover')) {
            Rally.ui.popover.PopoverFactory.bake({
                field: 'WorkProduct',
                target: this.getEl().down('.formatted-id-link'),
                type: this.value._type,
                oid: this.value.ObjectID,
                context: this.getContext()
            });
        }
    },
    
    onDestroy: function() {
        if(this._delayedTask) {
            this._delayedTask.cancel();
        }
    }
    

    });}

  3. 所以,如何在标题工具提示中插入更多字段,信息(或编辑,自定义)。例如美国enter image description here的发布字段

1 个答案:

答案 0 :(得分:0)

我在下面解决了第二个问题:

- 下载Rally.ui.popover.WorkProductPopover类的源代码,然后覆盖你想要的模板。