Dynamically add a datatable and a nested child datatable
Dynamically add a datatable and a nested child datatable
Test Case at http://live.datatables.net/hudizumo/1/
Before I start, my test case for some reason does not show the style as it does on my local computer which post some issue with the Output pane. I basically does not show the + sign image details_open/close.png. Maybe you have to copy/paste my code to make a local html file to see what I mean.
Anyway, my issue is that datatable.row.add in my javascript function appendRowIfNotExist does not populate the data into my child table. Any help will be appreciated.
function appendRowIfNotExist(datatable, rowdata, type) { //this will make sure the datatable rows are unique, no duplicates
//alert(datatable + ": " + rowdata);
datatable.row.add(rowdata).draw(); //add to teststepchild datatable, the front-end
}
Answers
To test, click on the first row of the first table, 123 - 456 - Name, ..., then click Create a nested table with data button. A new row with hard-coded data, 1, 001, test name, and test desc, should appear in the second table with the first column showing a green + sign with circle (details_open.png). A child table (id='teststepchild1') is there if you inspect it but no data is populated.