拉力赛:从表格中获取投资组合数据

时间:2012-03-14 10:17:07

标签: rally portfolio

我正在制作一个应该显示名称和FormattedID的自定义应用。 我用过这个例子 http://developer.rallydev.com/help/tables 并修改了一点但是功能相同。

我的功能出了问题但却找不到错误......

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- Copyright (c) 2011  Rally Software Development Corp.  All rights reserved -->
<html>
<head>
    <title>Samys Board</title>
    <meta name="Name" content="App Example: Table" />
   <meta name="Version" content="2010.4" />
   <meta name="Vendor" content="Rally Software" />
   <script type="text/javascript" src="/apps/1.24/sdk.js"></script>

   <script type="text/javascript">





       function tableExample() {

           var rallyDataSource = new rally.sdk.data.RallyDataSource('__WORKSPACE_OID__', '__PROJECT_OID__', '__PROJECT_SCOPING_UP__', '__PROJECT_SCOPING_DOWN__');

           modelAuswahl();

           function modelAuswahl() {

               var queryObj = { key: 'erg_story',
                   type: ["PortfolioItem"],
                   fetch: 'FormattedID,Name'
               };

               rallyDataSource.findAll(queryObj, elementShow);
           }


           function elementShow(results) {

               var tabellenBereich;

               var config = { columns:
             [{ key: 'FormattedID', header: 'Formatted ID', width: 100 },
             { key: 'Name'}]
               };

               var table = new rally.sdk.ui.Table(config);

               table.addRows(results.erg_story);


               tabellenBereich = document.getElementById('resultID');

               tabellenBereich.innerHTML = '<h1>Testing get Elements from Database</h1>';
               table.display(tabellenBereich);
               //----Ende representation-----------------
           };

       }

       rally.addOnLoad(tableExample); 
</script>
</head>
<body>
<table id="display" cellpadding=3 rules=rows>
<tr BGCOLOR=#99CCFF  height=25>
<td width=80;><strong>ID</td>
<td width=670;><strong>Name</td>
<td width=200;><strong>Original</td>
<td width=200;><strong>New Size</td>
<td width=200;><strong>Cycle Time</td>
</tr>
</table>
<div id="resultID"></div>
</body>
</html>

1 个答案:

答案 0 :(得分:1)

萨米,

下面是一些可行的代码。

已修复了四件事。

  • 表格可以直接显示在div中(您可以传入div名称)
  • 您不需要html表格
  • 我更改了元数据以引用您应用的名称(然后我们可以跟踪有多少人写应用
  • 您正在引用我们的App SDK 1.24,因此我们的WSAPI。版本1.24中不存在投资组合项目。您可以在Web服务结果中看到

标记

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- Copyright (c) 2011  Rally Software Development Corp.  All rights reserved -->
<html>
<head>
    <title>Samys Board</title>
    <meta name="Name" content="App: Samys Table" />
   <meta name="Version" content="2010.4" />
   <meta name="Vendor" content="Rally Software" />
   <script type="text/javascript" src="/apps/1.30/sdk.js"></script>

   <script type="text/javascript">





       function tableExample() {

           var rallyDataSource = new rally.sdk.data.RallyDataSource('__WORKSPACE_OID__', '__PROJECT_OID__', '__PROJECT_SCOPING_UP__', '__PROJECT_SCOPING_DOWN__');

           modelAuswahl();

           function modelAuswahl() {

               var queryObj = { key: 'erg_story',
                   type: ["PortfolioItem"],
                   fetch: 'FormattedID,Name'
               };

               rallyDataSource.findAll(queryObj, elementShow);
           }


           function elementShow(results) {

               var config = { columns:
             [{ key: 'FormattedID', header: 'Formatted ID', width: 100 },
             { key: 'Name'}]
               };

               var table = new rally.sdk.ui.Table(config);

               table.addRows(results.erg_story);

               table.display('resultID');
               //----Ende representation-----------------
           };

       }

       rally.addOnLoad(tableExample); 
</script>
</head>
<body>
<div id="resultID"></div>
</body>
</html>