我正在尝试为 Rally 创建一个新应用程序,而且我对 Rally SDK 和 JavaScript 都是新手。我找到了有关构建您的第一个 Rally 应用程序的教程,并尝试从那里开始。但是,在执行示例时出现错误。
Uncaught TypeError: Cannot call method 'refresh' of undefined
起初我以为我做错了什么,但最终我复制并粘贴了整个示例应用程序,却发现示例项目也发生了这种情况。
任何能指出我成功调试的正确方向的东西都将不胜感激!
App.js
我正在使用的全部内容(来自示例)是这样的:
Ext.define('CustomApp', {
extend: 'Rally.app.App',
componentCls: 'app',
items: { html: '<a href="https://help.rallydev.com/apps/2.0rc2/doc/">App SDK 2.0rc2 Docs</a>' },
launch: function () {
this.iterationCombobox = this.add({
xtype: 'rallyiterationcombobox',
listeners: {
change: this._onIterationComboboxChanged,
ready: this._onIterationComboboxLoad,
scope: this
}
});
},
_onIterationComboboxLoad: function () {
var addNewConfig = {
xtype: 'rallyaddnew',
recordTypes: ['User Story', 'Defect'],
ignoredRequiredFields: ['Name', 'ScheduleState', 'Project'],
showAddWithDetails: false,
listeners: {
beforecreate: this._onBeforeCreate,
scope: this
}
};
this.addNew = this.add(addNewConfig);
var cardBoardConfig = {
xtype: 'rallycardboard',
types: ['Defect', 'User Story'],
attribute: 'ScheduleState',
storeConfig: {
filters: [this.iterationCombobox.getQueryFromSelected()]
}
};
this.cardBoard = this.add(cardBoardConfig);
},
_onBeforeCreate: function (addNewComponent, record) {
record.set('Iteration', this.iterationCombobox.getValue());
},
_onIterationComboboxChanged: function () {
var config = {
storeConfig: {
filters: [this.iterationCombobox.getQueryFromSelected()]
}
};
this.cardBoard.refresh(config);
}
});