Grouping in DataTables
Grouping in DataTables
I try to group rows in DataTables but I cannot manage it to work. MY code. is the follwoin g:
$('#ordersTableId').DataTable(
{
data: myData,
columns: [
{"title":"Id Cmd"},
{"title":"Date Cmd"},
{"title":"Email client"},
{"title":"Nom client"},
{"title":"Article"},
{"title":"Quantité"},
{"title":"Prix"}
],
rowGroup: { dataSrc: ['Id Cmd', 'Prix']}
});
Where 'Id Cmd' is the main grouping column name and 'Prix' is the subgrouping column. It turns out that the main grouping works but not the subgrouping. Any idea?
Thanks
Answers
rowGroup.dataSrc
isn't the title field, it'sAs you're using array based, you just pass in the number of the column, so something like
Colin
Ok great thanks. In the examples it shows string identifiers for the columns not indexes.