在 Rally SDK 2 中,某些记录类型不适用于 WSAPIDataStore

In Rally SDK 2, are some record types not available for a WSAPIDataStore?

本文关键字:类型 记录 不适用 适用于 WSAPIDataStore SDK Rally      更新时间:2023-09-26

当我为用户故事制作一个快速的 wsapidatastore 时,它可以工作:

Ext.create('Rally.data.WsapiDataStore', {
            model: 'User Story',
            autoLoad: true,
            listeners: {
                load: this._onArtifactsLoaded,
                scope: this
            }
        });

但是如果我将其更改为工件,则会出现错误:

Ext.create('Rally.data.WsapiDataStore', {
            model: 'Artifact',
            autoLoad: true,
            listeners: {
                load: this._onArtifactsLoaded,
                scope: this
            }
        });

控制台 说:

Uncaught TypeError: Cannot call method 'replace' of undefined sdk-debug.js:104071
Ext.define._buildTypeInfo sdk-debug.js:104071
Ext.define.getModels sdk-debug.js:104025
Ext.Array.each sdk-debug.js:956
Ext.define.getModels sdk-debug.js:104024
Ext.define.getModel sdk-debug.js:103985
Ext.define.load sdk-debug.js:104379
(anonymous function)

模型工厂中似乎有错误。

如果需要解决方法,可以使用此行代码将工件添加为合法类型。

Rally.data.ModelTypes.types.artifact = 'artifact';