Would like to use child rows. How do I initialize the child rows?
Would like to use child rows. How do I initialize the child rows?
Fairly new at this. I've studied the example for child rows.
I don't understand the example javascript lines 1-18:
/* Formatting function for row details - modify as you need */
function format ( d ) {
// d
is the original data object for the row
return '
Full name: | '+ ''+d.name+' | '+ '
Extension number: | '+ ''+d.extn+' | '+ '
Extra info: | '+ 'And any further details here (images etc)... | '+ '
';
}
What do I replace //'d' . . . . with?
My table is defined:
$(document).ready(function() {
var table = $('#example').dataTable( {
"ajax": "jwreck.json",
"columns": [
{
"class": 'details-control',
"orderable": false,
"data": null,
"defaultContent": ''
},
{ "data": "vname" },
{ "data": "vtype" },
{ "data": "losscause" },
{ "data": "losstype" },
{ "data": "ylost", text_data_delimiter: ",", filter_type: "auto_complete" },
{ "data": "homeport" }
],
"order": [[1, 'asc']]
});
Can you provide an example with the full code?
Thank you,
David Smiht