【问题标题】:I can read Name of the release, but not able to read can't read ReleaseDate from the release in rally我可以读取版本的名称,但无法读取无法读取拉力赛版本中的 ReleaseDate
【发布时间】:2014-07-21 22:58:19
【问题描述】:

columnValue = columnValue.get('Name');

给我发布的名称 但无法读取 ReleaseDate

columnvalue1 = columnValue.get('ReleaseEndDate');

这给了我错误 Uncaught TypeError: undefined is not a function

这是我的发布对象

columnValue 值

j {phantom: false, internalId: "ext-record-2", raw: Object, data: Object, modified: Object…}

数据:对象 创建日期:空 GrossEstimateConversionRatio: ""

名称:“第 24 版” 备注:“” 对象 ID:12788620953 计划速度:空

项目:“” 发布日期:2014 年 9 月 17 日星期三 10:29:59 GMT+0530(印度标准时间)

发布开始日期:2014 年 7 月 23 日星期三 10:30:00 GMT+0530(印度标准时间) 修订历史:“”

【问题讨论】:

    标签: javascript rally


    【解决方案1】:

    发布对象有ReleaseStartDateReleaseDateWS API 中没有 ReleaseEndDate。

    使用发布日期。

    尝试使用指南中的简单网格this example。将model: 'userstory'替换为model: 'release',并使用config:

    columnCfgs:[
        'Name',
        'ReleaseStartDate',
        'ReleaseDate'
    ]
    

    您应该会看到 ReleaseDate。

    然后从需要显式获取 ReleaseDate 的网格中尝试custom data example。修改该示例以显示发布网格而不是用户故事网格。您可以这样做以根据 ReleaseStartDate 和 ReleaseDate 的值创建自定义列 Release Dates:

    launch: function() {
        Ext.create('Rally.data.wsapi.Store', {
            model: 'release',
            autoLoad: true,
            listeners: {
                load: this._onDataLoaded,
                scope: this
            },
            fetch: ['Name', 'ReleaseStartDate', 'ReleaseDate']
            //fetch: ['Name', 'ReleaseStartDate']
        });
    },
     _onDataLoaded: function(store, data) {
        var records = _.map(data, function(record) {
            console.log(record);
            return Ext.apply({
                ReleaseDates: record.get('ReleaseStartDate') + " -- " + record.get('ReleaseDate')
            }, record.getData());
        });
    
        this.add({
            xtype: 'rallygrid',
            showPagingToolbar: false,
            showRowActionsColumn: false,
            editable: false,
            store: Ext.create('Rally.data.custom.Store', {
                data: records
            }),
            columnCfgs: [
                {
                    text: 'Name',
                    dataIndex: 'Name'
                },
                {
                    text: 'Release Dates',
                    dataIndex: 'ReleaseDates',
                    flex: 1
                }
            ]
        });
    }
    

    这也应该显示 ReleaseDate 只要 fetch 包括 ReleaseDate fetch: ['Name', 'ReleaseStartDate',ReleaseDate']

    问题很可能与您的代码有关。从上面的工作示例开始,看看是否返回了 ReleaseDate。

    【讨论】:

    • 是的,我也尝试了那些..我得到了同样的错误
    • 我用显示 ReleaseDate 的网格示例更新了我的帖子。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-26
    • 1970-01-01
    • 1970-01-01
    • 2021-07-12
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多