2014-07-23 2 views
-2

내 목표는 대시 보드의 랠리 눈금을 사용하는 커스텀 HTML 앱에서 일부 맞춤 포트폴리오 항목 (이그 제 큐 티브 챔피언이라고 함)을 표시하는 것입니다. 나는 문서들과 몇 가지 예들을 살펴 보았고 이것이 가능한 것처럼 보이지 않는다. 아무도 이것을 성취하지 못했습니까? 내 코드는 다음과 같습니다. 나는 다음을 사용하여 https://github.com/davidpthomas/BasicRallyGrid을 시작했다.맞춤 HTML 애플리케이션을 사용할 때 랠리 그리드에 맞춤 포트폴리오 필드를 표시 할 수 있습니까?

<!DOCTYPE html> 
<html> 
<head> 
    <title>BasicRallyGrid</title> 

    <script type="text/javascript" src="/apps/2.0rc2/sdk.js"></script> 

    <script type="text/javascript"> 
     Rally.onReady(function() { 
       // Custom Rally App that displays Stories in a grid. 
// 
// Note: various console debugging messages intentionally kept in the code for learning purposes 

Ext.define('CustomApp', { 
    extend: 'Rally.app.App',  // The parent class manages the app 'lifecycle' and calls launch() when ready 
    componentCls: 'app',   // CSS styles found in app.css 

    // Entry Point to App 
    launch: function() { 

     console.log('our first app');  // see console api: https://developers.google.com/chrome-developer-tools/docs/console-api 
     this._loadData();     // we need to prefix with 'this.' so we call a method found at the app level. 
    }, 

    // Get data from Rally 
    _loadData: function() { 

     var myStore = Ext.create('Rally.data.wsapi.Store', { 
      model: 'PortfolioItem', 
      autoLoad: true,       // <----- Don't forget to set this to true! heh 
      listeners: { 
       load: function(myStore, myData, success) { 
        console.log('got data!', myStore, myData); 
        this._loadGrid(myStore);  // if we did NOT pass scope:this below, this line would be incorrectly trying to call _createGrid() on the store which does not exist. 
       }, 
       scope: this       // This tells the wsapi data store to forward pass along the app-level context into ALL listener functions 
      }, 
      fetch: ['Executive Champion', 'Name', 'ScheduleState'] // Look in the WSAPI docs online to see all fields available! 
     }); 

    }, 

    // Create and Show a Grid of given stories 
    _loadGrid: function(myStoryStore) { 

     var myGrid = Ext.create('Rally.ui.grid.Grid', { 
     store: myStoryStore, 
     columnCfgs: [   
      'Executive Champion', 'Name', 'ScheduleState' 
     ] 
     }); 

     this.add(myGrid);  

     console.log('what is this?', this); 

    } 

}); 


      Rally.launchApp('CustomApp', { 
       name:"BasicRallyGrid", 
       parentRepos:"" 
      }); 

     }); 
    </script> 


    <style type="text/css"> 
     .app { 
    /* Add app styles here */ 
} 

    </style> 
</head> 
<body></body> 
</html> 
+0

당신은 무엇을하려고 했습니까? – ciuak

+0

내가 사용한 코드가 업데이트되었습니다. – user3869933

답변

0

그리드에 PI 사용자 정의 필드 값을 표시하는 것은 가능합니다. 사용자 정의 필드에 DisplayName에 공백이있는 경우에도 코드에서 'Executive Champion'의 공백을 제거하십시오.

다음은 예입니다.

이름 : PiCustom

표시 이름 : PiCustom

작업 공간 관리자 권한이 해당 페이지를 볼 필요를 내가 설정에 표시됩니다 포트폴리오 항목 객체에 사용자 정의 필드가> 다음과 같이 & 프로젝트는 작업 공간. PiCustom, c_PiCustom

는 작업 공간 관리자가이 사용자 정의 필드의 표시 이름을 변경하는 경우 :

WS API 참조 c_PiCustom로이 분야 하나 하나가 잘 작동 내 코드에서

을 (C_와 함께 사용자 정의 필드를 표시하기 위해 자동으로 앞에 추가)

이름 : PiCustom

표시 이름을 다음과 같이 공간을 포함하는 파이를 사용자 정의

그것은 여전히 ​​WS API

c_PiCustom으로 표시되며,이 두 가지 방법 중 하나는 여전히 작동 내 코드에서이 필드를 참조하는 데 : PiCustom, c_PiCustom

하지만 Pi Custom가 작동하지 않습니다를.

코드에서 공백을 제거하십시오. 또는 WS API에서 해당 필드의 정확한 철자를 확인하고 해당 규칙을 따르십시오. 여기

전체 예는 2.0rc3을 사용하고 있습니다 :

Ext.define('CustomApp', { 
    extend: 'Rally.app.App', 
    componentCls: 'app', 
    launch: function() { 
       this.add({ 
        xtype: 'rallygrid', 
        model: 'PortfolioItem/Feature', 
        enableRanking: true, 
        storeConfig: { 
         context: { 
          context: this.getContext().getDataContext() 
         } 
        }, 
        { 
         dataIndex: 'FormattedID' 
        },{ 
         dataIndex: 'Name', 
        }, 
        { 
         dataIndex: 'PiCustom' 
        } 
        ] 
       }); 
    } 
}); 
+0

고마워요! 엄청난 도움이되었습니다. – user3869933