The loadBranch
function expects a Node object, not a node identifier. Try this instead:
$(window).load(function(){
studies_db().each( function (record,recordnumber) {
var node = $("#data_tree").treetable("node", "1");
$("#data_tree").treetable("loadBranch", node,
"<tr data-tt-id='2'>"+
"<td><b>Accession:</b> "+record.accession+"<br>"+
"<b>Title:</b> "+record.title+"<br>"+
"<b>Authors:</b> "+record.authors+"<br>"+
"<b>Release date: </b>"+record.date+"<br>"+
"<b>Number of markers: </b>"+record.samples+"<br>"+
"</td></tr>");
});
});
Note that I've also added a data-tt-id attribute to the tr, otherwise the treetable plugin will complain.
I have to admit that it is confusing that some functions expect a node identifier and others a Node
object... This is something that should be streamlined in the future.