Reputation: 138
I have a table powered by jQuery DataTables with checkbox in the first column to edit the row data. And I have a time column with duplicate values so I kept the row grouping on that time column.
Now I only need to show one checkbox for grouped row data. For the grouped time data I want to show only first checkbox to edit.
Upvotes: 2
Views: 1344
Reputation: 58880
Row grouping could be done with RowsGroup plugin for jQuery DataTables. Checkboxes could be implemented with Checkboxes plugin for jQuery DataTables.
I was able to combine the two using the code below.
var table = $('#example').DataTable({
'ajax': 'https://api.myjson.com/bins/1us28',
'rowsGroup': [0,3],
'columnDefs': [
{
'targets': 0,
'data': 3,
'checkboxes': {
'selectRow': false
}
}
]
});
See this example for code and demonstration.
'selectRow': false
as it doesn't behave as expected with row grouping.'data': 3
.Upvotes: 3