【发布时间】:2016-08-12 04:24:14
【问题描述】:
尝试运行为 Rally App SDK 测试文件夹示例提供的树视图示例 [此处] [1] - https://help.rallydev.com/apps/2.0/doc/#!/api/Rally.ui.tree.Tree [1]
尝试为 usestory 和 test 文件夹提供的示例都只加载顶层,在 userstory 的情况下不加载子任务/用户故事,而测试文件夹不加载子文件夹或测试用例。
这是 App.js 文件的摘录。
Ext.define('CustomApp', {
extend: 'Rally.app.App',
componentCls: 'app',
launch: function() {
this.add({
xtype: 'rallytree',
topLevelModel: Ext.identityFn('TestFolder'),
childModelTypeForRecordFn: function(record){
if(record.get('Children') && record.get('Children').length > 0){
return 'TestFolder';
} else {
return 'TestCase';
}
},
givenAParentRecordWhatIsTheAttributeConnectingAChildToThisParentFn: function(record){
if(record.get('Children') && record.get('Children').length > 0){
return 'Parent';
} else {
return 'TestFolder';
}
},
canExpandFn: function(record){
return record.get('Children') && record.get('Children').length > 0
|| record.get('TestCases') && record.get('TestCases').length > 0;
},
enableDragAndDrop: false,
dragThisGroupOnMeFn: function(record){
if(record.get('_type') === 'testfolder'){
if(record.get('Children') && record.get('Children').length > 0){
return 'testfolder';
}
if(record.get('TestCases') && record.get('TestCases').length > 0){
return 'testcase';
}
return ['testfolder', 'testcase'];
}
},
topLevelStoreConfig: {
sorters: []
},
childItemsStoreConfigForParentRecordFn: function(){
return {
sorters: []
};
}
//remaining config omitted for brevity
/**/
});
//API Docs: https://help.rallydev.com/apps/2.1/doc/
}
});
【问题讨论】:
标签: rally