Problem in Group By
Problem in Group By
antoniocib
Posts: 277Questions: 62Answers: 1
This is the pic of the problem:
The code in Js is:
var table4 = $('#dl1').DataTable( {
dom: 'Bfrtip',
ajax: {
url: 'php/table.dl1.php',
type: 'POST'
},
order:[1],
rowGroup:{
dataSrc: function (data) {
return data.dlinea;
}
},
hello all, I used the rowGroup function to group all the data in the table through the column "Autista Linea" but I didn't understand why it duplicates the filters.
This discussion has been closed.
Answers
The rowGroup groupings are affected by the table sorting. Take a look at this example:
https://datatables.net/extensions/rowgroup/examples/initialisation/ajaxObjects.html
It is grouped by the Office column and sorted by Office. Try sorting another column and you will see the groupings are separated. This example explains how to force the dataSrc column to always be sorted to keep the groups together.
Kevin
So Kevin i must order by "Autista Linea" and rowGroup by "Autista Linea"?