0
試圖運行提供了一種用於汽車拉力應用SDK樹形視圖示例testfolders例如[這裏] [1] - https://help.rallydev.com/apps/2.0/doc/#!/api/Rally.ui.tree.Tree [1]拉力應用SDK,只加載頂夾
試圖提供用於usestory實施例和測試文件夾都只加載最高級別,不加載子任務/用戶故事的情況下用戶名爲&對於測試文件夾不加載子文件夾或測試用例。
以下是App.js文件的摘錄。
Ext.define('CustomApp', {
extend: 'Rally.app.App',
componentCls: 'app',
launch: function() {
\t
\t this.add({
\t \t \t \t xtype: 'rallytree',
\t \t \t \t topLevelModel: Ext.identityFn('TestFolder'),
\t \t \t \t childModelTypeForRecordFn: function(record){
\t \t \t \t if(record.get('Children') && record.get('Children').length > 0){
\t \t \t \t return 'TestFolder';
\t \t \t \t } else {
\t \t \t \t return 'TestCase';
\t \t \t \t }
\t \t \t \t },
\t \t \t \t givenAParentRecordWhatIsTheAttributeConnectingAChildToThisParentFn: function(record){
\t \t \t \t if(record.get('Children') && record.get('Children').length > 0){
\t \t \t \t return 'Parent';
\t \t \t \t } else {
\t \t \t \t return 'TestFolder';
\t \t \t \t }
\t \t \t \t },
\t \t \t \t canExpandFn: function(record){
\t \t \t \t return record.get('Children') && record.get('Children').length > 0
\t \t \t \t || record.get('TestCases') && record.get('TestCases').length > 0;
\t \t \t \t },
\t \t \t \t enableDragAndDrop: false,
\t \t \t \t dragThisGroupOnMeFn: function(record){
\t \t \t \t if(record.get('_type') === 'testfolder'){
\t \t \t \t if(record.get('Children') && record.get('Children').length > 0){
\t \t \t \t return 'testfolder';
\t \t \t \t }
\t \t \t \t if(record.get('TestCases') && record.get('TestCases').length > 0){
\t \t \t \t return 'testcase';
\t \t \t \t }
\t \t \t \t return ['testfolder', 'testcase'];
\t \t \t \t }
\t \t \t \t },
\t \t \t \t topLevelStoreConfig: {
\t \t \t \t sorters: []
\t \t \t \t },
\t \t \t \t childItemsStoreConfigForParentRecordFn: function(){
\t \t \t \t return {
\t \t \t \t sorters: []
\t \t \t \t };
\t \t \t \t }
//remaining config omitted for brevity
/**/
});
//API Docs: https://help.rallydev.com/apps/2.1/doc/
}
});