2013-01-05 1 views
1

사용자 스토리의 부모 기능을 표시하고 동일한 상위 필드로 정렬하는 데 문제가 있습니다. 여기 내 코드가있다. 부모가 다른 사용자 스토리가 아니라면 상위 열에 빈 값이 표시됩니다. 부모 필드별로 정렬 할 수 없습니다.집회 SDK 2.0 사용자 스토리 부모 (기능) 표시 및 rallygrid의 부모 별 정렬

도움을 주시면 대단히 감사하겠습니다.

감사합니다.

<script type="text/javascript"> 
     Rally.onReady(function() { 
      Ext.define('CustomApp', { 
       extend: 'Rally.app.App', 
       componentCls: 'app', 

       items: [ 
        { 
         xtype: 'container', 
         itemId: 'iterationFilter' 
        }, 
        { 
         xtype: 'container', 
         itemId: 'grid', 
         width: 800 
        } 
       ], 

       launch: function() { 
        this.down('#iterationFilter').add({ 
         xtype: 'rallyiterationcombobox', 
         cls: 'filter', 
         model: 'UserStory', 
         field: 'Iteration', 
         listeners: { 
          ready: this._onIterationComboBoxLoad, 
          select: this._onIterationComboBoxSelect, 
          scope: this 
         } 
        }); 
       }, 

       _onIterationComboBoxLoad: function(comboBox) { 
        this.iterationComboBox = comboBox; 

        Rally.data.ModelFactory.getModel({ 
         type: 'UserStory', 
         success: this._onModelRetrieved, 
         scope: this 
        }); 
       },     

       _getFilter: function() { 
        var filter = []; 

        filter.push({ 
         property: 'Iteration', 
         operator: '=', 
         value: this.iterationComboBox.getValue() 
        }); 

        return filter; 
       }, 


       _onIterationComboBoxSelect: function() { 
        this._onSettingsChange(); 
       }, 

       _onSettingsChange: function() { 
        this.grid.filter(this._getFilter(), true, true); 
       }, 

       _onModelRetrieved: function(model) { 
        this.grid = this.down('#grid').add({ 
         xtype: 'rallygrid', 
         model: model, 
         columnCfgs: [ 
          'FormattedID', 
          'Name', 
          'Plan Estimate', 
          'Parent', 
          'Schedule State', 
          'StoryType' 
         ], 
         storeConfig: { 
          context: this.context.getDataContext(), 
          filters: this._getFilter() 
         }, 
         showPagingToolbar: true, 
         enableEditing: false 
        }); 
       } 



      }); 
     }); 


     Rally.launchApp('CustomApp', { 
      name: 'Defect Dashboard' 
     }); 
</script> 

답변

1

사용자 스토리에는 학부모를위한 두 개의 다른 입력란이 있습니다. Parent가 다른 이야기라면 Parent를 사용합니다. 부모가 지형지 물과 같은 포트폴리오 항목 인 경우 부모는 PortfolioItem이라고합니다.

우리의 웹 서비스 docs을 보면 사용자 스토리에 대한 필드를 볼 수 있습니다. 당신이 할 당신의 예에서

내가 적어도 각 사용자 스토리에 대한 기능의 이름을 표시 할 수 있었다 PorfolioItem

columnCfgs: [ 
          'FormattedID', 
          'Name', 
          'Plan Estimate', 
          'PortfolioItem', 
          'Schedule State', 
          'StoryType' 
         ], 
+0

감사를 참조하지만 : 방법으로 정렬보다 우선합니다.. 여전히 작동하지 않습니다. 'Plan Estimate'-> 'PlanEstimate'및 'ScheduleState'-> 'ScheduleState'를 선택합니다. 그러나 'PortfolioItem'은 여전히 ​​그리드에 표시되지 않습니다. columnCfgs : –

+0

사실, 어떤 필드 "정렬 가능한 [ \t는 \t '이름', \t 'PlanEstimate' \t 'PortfolioItem' \t 'ScheduleState' \t 'StoryType' 'FormattedID']를 = False "는이 격자에 표시 할 수 없습니다. 다른 몇 가지 필드로 테스트되었습니다. 그리고 'PortfolioItem'은 정렬 할 수 없습니다. 이는 PortfolioItem/Feature별로 사용자 스토리 목록을 표시 할 수있는 방법이 없다는 것을 의미합니까? –

+0

표시를 위해 portolioitem의 이름을 추출하기 위해 렌더러를 추가해야하는 것처럼 보입니다. –

0

을 포함하도록 열 CONFIGS을 변경합니다. 그래도 정렬 할 수있는 문제가 있습니다. :(

<!DOCTYPE html> 
    <html> 
    <head> 
     <title>Grid Example</title> 

     <script type="text/javascript" src="/apps/2.0p4/sdk.js?wsapiVersion=1.38"></script> 
     <script type="text/javascript"> 
       Rally.onReady(function() { 
        Ext.define('CustomApp', { 
         extend: 'Rally.app.App', 
         componentCls: 'app', 

         items: [ 
          { 
           xtype: 'container', 
           itemId: 'iterationFilter' 
          }, 
          { 
           xtype: 'container', 
           itemId: 'grid' 
           //width: 800 
          } 
         ], 

         launch: function() { 
          this.down('#iterationFilter').add({ 
           xtype: 'rallyiterationcombobox', 
           cls: 'filter', 
           model: 'UserStory', 
           field: 'Iteration', 
           listeners: { 
            ready: this._onIterationComboBoxLoad, 
            select: this._onIterationComboBoxSelect, 
            scope: this 
           } 
          }); 
         }, 

         _onIterationComboBoxLoad: function(comboBox) { 
          this.iterationComboBox = comboBox; 

          Rally.data.ModelFactory.getModel({ 
           type: 'UserStory', 
           success: this._onModelRetrieved, 
           scope: this 
          }); 
         },     

         _getFilter: function() { 
          var filter = []; 

          filter.push({ 
           property: 'Iteration', 
           operator: '=', 
           value: this.iterationComboBox.getValue() 
          }); 

          return filter; 
         }, 


         _onIterationComboBoxSelect: function() { 
          this._onSettingsChange(); 
         }, 

         _onSettingsChange: function() { 
          this.grid.filter(this._getFilter(), true, true); 
         }, 

         _onModelRetrieved: function(model) { 
          this.grid = this.down('#grid').add({ 
           xtype: 'rallygrid', 
           model: model, 
           columnCfgs: [ 
            'FormattedID', 
            'Name', 
            'PlanEstimate', 
            { 
             text: 'Feature', 
             dataIndex: 'PortfolioItem', 
             renderer: function(value, metaData, record, rowIndex, colIndex, store, view) { 
              if (value != null) { 
               return value.Name; 
              } 
              return ''; 
             } 
            }, 
            'ScheduleState', 
            'StoryType' 
           ], 
           storeConfig: { 
            context: this.context.getDataContext(), 
            remoteSort: false, 
            filters: this._getFilter() 
           }, 
           showPagingToolbar: true, 
           enableEditing: false 
          }); 
         } 



        }); 
       }); 


       Rally.launchApp('CustomApp', { 
        name: 'Defect Dashboard' 
       }); 
     </script> 

     <style type="text/css"> 
      .filter { 
       float: left; 
       margin: 5px 5px; 
       vertical-align: middle; 
      } 
     </style> 
    </head> 
    <body></body> 
    </html> 
0

렌더러와 수정 된 솔루션을 찾고, 당신은 추가 할 필요가있는 사용자가 설정 한 사용자 정의 컬럼에 doSort 방법입니다. 확실히 당신은 당신이 할 수있는 다음, 가게에 false로 remoteSort 설정 확인

 doSort: function(state) { 
      var ds = this.up('grid').getStore(); 
      var field = this.getSortParam(); 
      ds.sort({ 
       property: field, 
       direction: state, 
       sorterFn: function(v1, v2){ 
        v1 = v1.get(field); 
        v2 = v2.get(field); 
        return v1.length > v2.length ? 1 : (v1.length < v2.length ? -1 : 0); 
       } 
      }); 
     } 

이 정렬은 필드의 길이에 의해 정렬 발생,하지만 당신은 당신이 원하는 것을 할 변경할 수 있습니다 응답을 Ext js sorting custom column by contents