使用SDK 2,我创建了一个组合框,可以让我选择一个版本。我有一个想要对ChangeSets数组做一些事情的监听器,但是数组只返回属性信息(ref等)。在过去,我可以在父母身上找到我想要的字段,也可以在孩子们看到它们。那么,我如何让ChangeSets提供修订版,比如说?
这是组合框的定义:
this.down('#buildSelector').add({
xtype: 'rallycombobox',
displayField: 'Number',
listeners: {
scope: this,
select: function(combo, records, eOpts){
this._buildResults(combo.getRecord().data);//Build
},
ready: function(combo, records, eOpts){
this._buildResults(combo.getRecord().data);//Build
}
},
width: 280,
storeConfig: {
autoLoad: true,
model: 'Build',
pagesize: 20, //# of builds displayed in drop down
sorters: [{
property: 'CreationDate',
direction: 'DESC'
}],
listeners: {
load: function(store, records, successful){
console.log("dropdown records", records);
}
}
}
});
那个控制台日志给我这样的东西
dropdown records
Array[200]
[0 … 13]
0: Ext.Class.newClass
data: Object
BuildDefinition: Object
Changesets: Array[2]
0: Object
_rallyAPIMajor: "1"
_rallyAPIMinor: "31"
_ref: "https://audemo.rallydev.com/slm/webservice/1.31/changeset/1260800.js"
_refObjectName: "BuildHealthReportRepo:1000"
_type: "Changeset"
__proto__: Object
1: Object
等...
答案 0 :(得分:3)
您可以通过向storeConfig对象添加带有字段名称数组的fetch属性来执行此操作。如果您只想获取内部版本号,变更集和修订版,则属性定义可能如下所示:
storeConfig: {
fetch: ['Number', 'Changesets', 'Revision'],
autoLoad: true,
model: 'Build',
pagesize: 20, //# of builds displayed in drop down
sorters: [{
property: 'CreationDate',
direction: 'DESC'
}],
listeners: {
load: function(store, records, successful){
console.log("dropdown records", records);
}
}
}