Problem with child-row data in a second datatable reload?
Problem with child-row data in a second datatable reload?
$('#example tbody').on('click', 'td.details-control', function () {
var tr = $(this).parents('tr');
var row = table.row( tr );
if ( row.child.isShown() ) {
// This row is already open - close it
row.child.hide();
tr.removeClass('shown');
}
else {
// Open this row (the format() function would return the data to be shown)
row.child( format(row.data()) ).show(); // <-- problem here
tr.addClass('shown');
}
} );
I using this example for my code, but i had a problem with the line a marked [ row.data() ] it's only return data value with a first run, and always return null (data undefined) since a second reload datatable, only fix by refresh page. Please help me to fix it?
There are my datatable config
destroy: true,
paging: false,
searching: false,
info: false,