How can i add a row in a datatable with child rows (show extra / detailed information)
How can i add a row in a datatable with child rows (show extra / detailed information)

Link to test case: datatable with child rows
Debugger code (debug.datatables.net):
Error messages shown: DataTables warning: table id=example - Requested unknown parameter 'name' for row 5, column 1. For more information about this error, please see http://datatables.net/tn/4
Description of problem: I have the message error when i try to add a row with this function :
$('#addRow').on( 'click', function () {
table.row.add([
{
"id": '900',
"name": "Herve Zyon",
"position": "Accountant",
"salary": "$162,700",
"start_date": "2008/11/28",
"office": "Tokyo",
"extn": "5407"
}
] ).draw( false );
} );
I don't know how to feel the first column which contains an image by the function above.
This question has an accepted answers - jump to answer
Answers
row.add()
expects only one row of data so you don't want to put it in an array. Whererows.add()
expects one or more rows and looks for the rows to be in an array. Withrows.add()
just pass the object as the parameter, like this:Kevin
Thanks!