Note that there are some explanatory texts on larger screens.

plurals
  1. POfeed json data into html table
    primarykey
    data
    text
    <p>I need to build a table based on json response i'm getting when calling API, calling the API and get the JSON works fine, just I didn't found any documentation about building a table and pass from x.js to x.html. I succeed to pass only 1 param/value from the json.</p> <p>my json looks like this: (it's Jenkins API result)</p> <pre><code> { "builds": [ { "duration": 24503, "id": "2013-12-11_19-48-55", "number": 33, "result": "FAILURE", "timestamp": 1386791335164 }, { "duration": 24553, "id": "2013-12-11_19-00-27", "number": 32, "result": "FAILURE", "timestamp": 1386788427803 }, { "duration": 24237, "id": "2013-12-11_18-59-51", "number": 31, "result": "FAILURE", "timestamp": 1386788391179 }, </code></pre> <p>JS Code</p> <pre><code> Meteor.call('jenkinsServiceBuild', function(err, respJson) { if(err) { window.alert("Error: " + err.reason); console.log("error occured on receiving data on server. ", err ); } else { //window.alert("Success: "); console.log("respJson: ", respJson.builds[1].id); //window.alert(respJson.length + ' tweets received.'); var buildsList = respJson.builds[1].id; Session.set("recentBuilds", respJson.builds[1].id); } $('#buildButton').removeAttr('disabled').val('build'); }) }, }); Template.dashboard.helpers({ recentBuilds : function() { return Session.get("recentBuilds"); //recentBuilds: buildsList </code></pre> <p>} });</p> <p>HTML Code</p> <pre><code>&lt;template name="dashboard"&gt; &lt;div class="control-group"&gt; &lt;div class="controls"&gt; &lt;input type="button" value="build" class="btn btn-info" id="buildButton"/&gt; &lt;/div&gt; &lt;br&gt;&lt;br&gt; ___{{recentBuilds}}___ &lt;/template&gt; </code></pre> <p>Thanks Ronen</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload