0

当纸板仅显示功能时,我没有问题向我的纸板中的功能显示父级:

cardConfig: {
    xtype: 'rallycard',
    listeners: {
        fieldclick : function(field, card) {
            _loadDetails(card); 
        }
    },
    fields: [
        'Name',
        // 'Parent' - either one of these ways works
        {
            name: 'Parent',
            fetch: ['Parent'],
            renderTpl: Ext.create('Ext.XTemplate', 'Parent: {Parent.Name}')
        }
    ]
},

但是,当我的看板同时显示功能和汇总时,父信息不会显示在卡片上。我已经尝试有条件地设置它,或者使用渲染器而不是 renderTpl(渲染器从未被调用) - 我无法在 API 文档中找到正确执行此操作的方法。

4

1 回答 1

0

这是一个 App.js 代码,其中 Theme 卡不显示 Parent 字段,但 Feature 和 Initiative 卡会:

Ext.define('CustomApp', { extend: 'Rally.app.App', componentCls: 'app',

    launch: function() {
        var addNewConfig = {
            xtype: 'rallyaddnew',
            recordTypes: ['PortfolioItem/Feature', 'PortfolioItem/Initiative', 'PortfolioItem/Theme'],
            ignoredRequiredFields: ['Name', 'Project'],
            showAddWithDetails: false,
        };

        this.addNew = this.add(addNewConfig);
        var myCardConfig = {
               xtype: 'rallycard',
               fields: ['State','Parent']
            }
        var cardBoardConfig = {
            xtype: 'rallycardboard',
            types: ['PortfolioItem/Feature', 'PortfolioItem/Initiative', 'PortfolioItem/Theme'],
            attribute: 'InvestmentCategory',
            cardConfig: myCardConfig
        };

        this.cardBoard = this.add(cardBoardConfig);
    }
});
于 2013-08-02T18:39:36.463 回答