2014-08-28 1 views
-3

나는이 사이트에서 스크립트를 가져 왔으며 반복과 함께 records.But와 함께 이름을 포함하고 싶었지만 객체 메시지를 보낼 때 HTML 페이지를 실행합니다.이 문제를 해결해야합니다. 도움을 찾고 사전에 감사드립니다. 사용자 스토리 객체에의존 관계가있는 사용자 사례

-Mani

description here][1] 

<!DOCTYPE html> 
<html> 
*emphasized text*<head> 
    <title>UserStoryWithPredecessors</title> 

    <script type="text/javascript" src="https://rally1.rallydev.com/apps/2.0p5/sdk.js"></script> 

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

       launch: function() { 
        Ext.create('Rally.data.WsapiDataStore', { 
         model: 'UserStory', 
         fetch: 
       ['FormattedID','Name','Iteration','Predecessors','FormattedID','CreationDate'], 
         autoLoad: true, 



         listeners: { 
          load: this._onDataLoaded, 
                  ///query: q, 
          scope: this 
         } 
        }); 
       },     

       _onDataLoaded: function(store, data) { 
        var records = []; 
        Ext.Array.each(data, function(record) { 
         //Perform custom actions with the data here 
         //Calculations, etc. 

         var myPredecessors = record.get('Predecessors'); 

         var predecessorData = ""; 
         var predecessorCreationDate = ""; 

         // Loop through and process Predecessor data 
         for (var i=0; i<myPredecessors.length; i++) { 
          thisPredecessor = myPredecessors[i]; 
          thisPredecessorFormattedID = thisPredecessor["FormattedID"]; 
          thisPredecessorName = thisPredecessor["Name"]; 

          // Re-format Date/time string 
          thisPredecessorCreationDateString = thisPredecessor["CreationDate"]; 
          thisPredecessorCreationDate = new 
          Date(thisPredecessorCreationDateString); 
          thisYear = thisPredecessorCreationDate.getFullYear(); 
          thisMonth = thisPredecessorCreationDate.getMonth(); 
          thisDay = thisPredecessorCreationDate.getDate(); 

          thisPredecessorFormattedDate = thisMonth + "/" + thisDay + "/" + 
          thisYear; 

          // Post-pend updated data to value for array 
          predecessorData += thisPredecessorFormattedID + ": " + 
          thisPredecessorName + "<br>"        
          predecessorCreationDate += thisPredecessorFormattedDate + "<br>";          
         } 


         records.push({ 
          FormattedID: record.get('FormattedID'), 
          Name: record.get('Name'), 
          Iteration: String(record.get('Iteration')), 
          Predecessors: predecessorData, 
          PredecessorCreationDate: predecessorCreationDate, 

          }); 
        }); 

        this.add({ 
         xtype: 'rallygrid', 
         store: Ext.create('Rally.data.custom.Store', { 
          data: records, 
          pageSize: 20 
         }), 
         columnCfgs: [ 
          { 
           text: 'FormattedID', dataIndex: 'FormattedID', width: '60px' 
          }, 
          { 
           text: 'Name', dataIndex: 'Name', width: '400px' 
          }, 
      { 
           text: 'Iteration', dataIndex: 'Iteration', width: '500px' 
          }, 
          { 
           text: 'Predecessors', dataIndex: 'Predecessors', width: '200px' 
          }, 
          { 
           text: 'Predecessor Creation Date(s)', dataIndex: 
           'PredecessorCreationDate', width: '200px' 
          } 
         ] 
        }); 
       } 
      }); 
      Rally.launchApp('CustomApp', { 
       name: 'UserStoryWithPredecessors' 
      }); 
     }); 
    </script> 

    <style type="text/css"> 
     .app { 
      /* Add app styles here */ 
     } 
    </style> 
</head> 
    <body></body> 
</html> 
+1

되어 있지 않은지 확인하려면? – blex

+0

나는 지금 막 added.Also 반복에 근거를 두는 거르는 조건을 포함하고 싶다 추가했다. –

+0

이 HTML 코드는 보고서를 생성하는 데 사용됩니다. 필터링 조건이 인쇄 옵션으로 추가되어야합니다. 완전한 코드를 얻을 수 있으므로 도움이 될 것입니다. 도움을 요청하십시오. –

답변

0

반복 속성은 WS API의 실제 반복 객체에 대한 참조입니다. 이 같은 구문을 사용하여 이름을 통과해야합니다

Iteration: (record.get('Iteration') && record.get('Iteration')._refObjectName) || 'None' 

당신은 반복이 전에 출력 널 코드는 어디 record.get('Iteration')._refObjectName)

+0

레코드를 채 웁니다. 한 가지 더 도움이 필요합니다.이 필터를 반복 필터링과 함께 보고서로 인쇄하고 싶습니다. 저 좀 도와 주 시겠어요..? –