Domanda

Sto facendo un'app personalizzata che dovrebbe mostrare il nome e il formato. Ho usato l'esempio in http://developer.llydev.com/help/tables e la modifica un po 'ma è la stessa funcionalità.

Qualcosa è sbagliato nella mia funzione ma non riesco a trovare l'errore ....

<!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>
.

È stato utile?

Soluzione

samy,

Di seguito è riportato un codice che funzionerà.

Quattro cose sono state corrette.

    .
  • Una tabella può essere visualizzata direttamente in un div (e puoi passare nel nome delv)
  • Non hai bisogno di una tabella HTML
  • Ho cambiato i meta dati per fare riferimento al nome della tua app (quindi possiamo tenere traccia di quante persone scrivono app
  • Stai facendo riferimento 1.24 della nostra app SDK e quindi il nostro WSAPI.Gli articoli del portafoglio non esistevano nella versione 1.24.Potresti vederlo nel risultato del servizio Web

Mark

<!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>
.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top