我正在为 Rally 自定义应用程序实现项目选择器,并希望在从选择器中选择父项时自动选择项目子项。我能够获得要选择的对象的 ObjectID 和 Name,但似乎无法从选择器中选择它们。我尝试使用“fireEvent”方法但没有成功。这是我到目前为止所拥有的:
var teamPick = this.down('#filterPanel').add({
xtype: 'rallymultiobjectpicker',
id: 'teams',
modelType: 'project',
fieldLabel: 'Teams',
listeners: {
select: function(field, selected) {
Ext.create('Rally.data.WsapiDataStore', {
autoLoad: true,
fetch: [ 'Name', 'ObjectID' ],
filters: [
{ property: 'Parent.ObjectID', value: selected.ObjectID }
],
model: 'Project',
listeners: {
load: function(store, data) {
Ext.Array.each(data, function(child) {
console.log(child.get('Name')); //Logs the child name
});
}
}
});
},
scope: this
}
});