階層ツリーは Rally サイト ( https://help.rallydev.com/apps/2.0rc3/doc/#!/api/Rally.ui.grid.TreeGrid ) で実験的なものとしてラベル付けされていることがわかります。階層ツリーを使用してアプリを構築したかったのですが、機能についていくつか質問がありました。ツリーをフィルタリングすることはできますか? また、特定のユーザー ストーリー (見積もり、todo、実際など) のタスクの合計を合計し、その合計をユーザー ストーリーの値としてリストすることはできますか? その下のリストにタスクがあるユーザーストーリーのリストを取得する別の方法はありますか?
1 に答える
0
ツリーグリッドではない例:このアプリは、個々のタスクの見積もり値が合計される、作業成果物 (ユーザー ストーリー) によってグループ化された現在のイテレーションのタスクのグリッドでグループおよび要約機能を使用します。完全なコードは、この github リポジトリにあります。
launch: function() {
var that = this;
var today = new Date().toISOString();
var stories = Ext.create('Rally.data.wsapi.Store', {
model: 'UserStory',
fetch: ['Tasks'],
filters: [
{
property: 'Iteration.StartDate',
operator: '<=',
value: today
},
{
property: 'Iteration.EndDate',
operator: '>=',
value: today
}
]
});
stories.load().then({
success: this.loadTasks,
scope: this
}).then({
success:function(results) {
that.makeGrid(results);
},
failure: function(){
console.log("oh noes!")
}
});
},
loadTasks: function(stories){
console.log("load tasks",stories)
var promises = [];
_.each(stories, function(story){
var tasks = story.get('Tasks');
if (tasks.Count > 0) {
tasks.store = story.getCollection('Tasks',{fetch:['Name','FormattedID','Estimate','State','Blocked','WorkProduct']});
promises.push(tasks.store.load());
}
});
return Deft.Promise.all(promises);
},
makeGrid: function(results){
var tasks = _.flatten(results);
var data = [];
_.each(tasks, function(task){
data.push(task.data);
})
_.each(data, function(record){
record.Story = record.WorkProduct.FormattedID + " " + record.WorkProduct.Name;;
})
this.add({
xtype: 'rallygrid',
showPagingToolbar: true,
showRowActionsColumn: true,
editable: false,
store: Ext.create('Rally.data.custom.Store', {
data: data,
groupField: 'Story',
}),
features: [{ftype:'groupingsummary'}],
columnCfgs: [
{
xtype: 'templatecolumn',text: 'ID',dataIndex: 'FormattedID',width: 100,
tpl: Ext.create('Rally.ui.renderer.template.FormattedIDTemplate'),
summaryRenderer: function() {
return "Estimate Total";
}
},
{
text: 'Name',dataIndex: 'Name',
},
{
text: 'State',dataIndex: 'State',xtype: 'templatecolumn',
tpl: Ext.create('Rally.ui.renderer.template.ScheduleStateTemplate',
{
states: ['Defined', 'In-Progress', 'Completed'],
field: {
name: 'State'
}
})
},
{
text: 'Estimate',dataIndex: 'Estimate',
summaryType: 'sum',
},
{
text: 'WorkProduct',dataIndex: 'WorkProduct',
renderer: function(val, meta, record) {
return '<a href="https://rally1.rallydev.com/#/detail/userstory/' + record.get('WorkProduct').ObjectID + '" target="_blank">' + record.get('WorkProduct').FormattedID + '</a>';
}
},
]
});
}
更新:タスク ストアをフィルター処理する場合は、ここにフィルターを含めます。
tasks.store = story.getCollection('Tasks',{fetch:['Name','FormattedID','Estimate','State','Blocked','WorkProduct'],filters:{property: 'State',operator: '<',value: 'Completed'}});
ツリーグリッドの例:あなたが参照した Rally.ui.grid.TreeGrid はまだ進行中の作業です。ツリーグリッドを使用したストーリー階層の実例を見たことがありませんが、それが不可能だというわけではありません。
ストーリー階層をテストしたところ、子ストーリーはエピック ストーリーの下に表示されませんでしたが、ストーリー/タスク階層は機能しました。フィルタリングも機能しました。次に例を示します。
Ext.define('CustomApp', {
extend: 'Rally.app.App',
componentCls: 'app',
launch:function(){
Ext.create('Rally.data.wsapi.TreeStoreBuilder').build({
models: ['userstory'],
autoLoad: true,
filters:[
{
property: 'Name',
operator: 'contains',
value: 'story'
}
],
enableHierarchy: true
}).then({
success: function(store) {
var grid = Ext.create('Ext.Container', {
items: [{
xtype: 'rallytreegrid',
columnCfgs: [
'Name',
'Owner'
],
store: store
}]
});
that.add(grid);
}
});
}
以下のスクリーンショットは、タスクが予想どおり子ストーリーの下にネストされていることを示していますが、子ストーリーは親の下にネストされていません。グリッドは、予想どおり名前でフィルター処理されます。
于 2014-06-30T20:01:06.030 に答える