How to add details-control to show child rows
How to add details-control to show child rows
Hello,
I'm trying to follow this example http://www.datatables.net/examples/api/row_details.html to display my child row details.
The problem is that I've noticed that in the example a 'details-control' column is defined at the beginning. In my situation I have the table ready with all the info (not from ajax) var table = jQuery('#igsv-MY_TABLE_KEY').DataTable();
so I can't define it as in the example, so all I need is to find a way to add a 'details-control' column at the beginning so that I'll have the "+" used to expand and show details.
I searched this forums as well but I couldn't find a simple way to add columns.
Thank you
Answers
Any thoughts?
All I need is to add this column
{
"className": 'details-control',
"orderable": false,
"data": null,
"defaultContent": ''
}
to my table
Hi lampamp,
You can add custom columns and their content using the
columnDefs
property:Additionally you may wish to check out this page: Generated content for a column
Hope this helps,