我正在构建一个 rallygrid 来显示父级故事。对于每一行,我想迭代该故事的所有孩子并从每个孩子故事中提取一些信息。例如
Ext.Array.each(data, function(record) {
//Perform custom actions with the data here
//Calculations, etc.
recName=record.get('Name');
if (recName.search(/\[Parent\]/i) != -1) {
// Grab Child Iterations
if (record.get('Children').length) {
var childlist = record.get('Children');
for (var child in childlist) {
// I want to get each child's Iteration !!!
}
} else {
childIter = "none";
}
records.push({
FormattedID: record.get('FormattedID'),
ScheduleState: record.get('ScheduleState'),
Name: recName,
NumChildren: record.get('Children').length,
PRDNumber: record.get('PRDNumber')
});
}
});
但是,record.get('Children') 会重新调整看起来像这样的对象:
_rallyAPIMajor "1"
_rallyAPIMinor "34"
_ref "https://rally1.rallydev.com/slm/webservice/1.34/hierarchicalrequirement/7272142216.js"
_refObjectName "[Comp] User Story"
_type "HierarchicalRequirement"
我假设有一些 Ext 调用将获取 _ref URI,下载它并将 JSON 解析为一个不错的对象,我可以开始做 childrecord.get('field'),但对于我的生活,我可以' t 找到要调用的正确函数。