我正在使用以下代码:
launch: function() {
Rally.data.ModelFactory.getModel({
type: 'UserStory',
success: function(model) {
this.down('#gridContainer').add({
xtype: 'rallygrid',
model: model,
columnCfgs: [
{
text: 'ID',
dataIndex: 'FormattedID',
width: 75
},
{
text: 'Name',
dataIndex: 'Name',
width: 500,
listeners: {
click: this._showTasks,
scope: this
}
}
]
});
},
scope: this
});
}
当用户从网格中单击用户故事时会调用函数 _showTasks,但我无法获取他们单击的用户故事的 ID。如果我console.log(this)我可以看到 ID 存储在一个名为selected的项目数组中,但我不确定该属性的路径。我还觉得可能有一种更简单的方法可以从网格中获取最近选择的用户故事?
最终目标是列出所选用户故事的所有子任务,或者在另一个拉力网格中,或者直接将它们打印到正文中。