Query about grouping
Query about grouping
Hi, I am passing data and columns to the DataTable using JSON array. And I'm using "rowgroup" to perform grouping based on speicfic column, but it's not working as expected. (see the attahed sceenshot). The "group" variable value is undefined.
When I passed the data to the DataTable using HTML code, it works properly.
Code snippet :
var table = $('#tblTrainerVenueList').DataTable({
"data":data, // Data JSON
"columns":dynamic_column, // Column JSON
"pageLength": 10,
"lengthChange": false,
"info": false,
"order": [[5, 'desc']],
"rowGroup": {
endRender: null,
startRender: function ( rows, group ) {
alert('rows : '+rows+ ': : '+group)
return group +' ('+rows.count()+')';
},
dataSrc: 5
}
});
Answers
What is different between your JSON data and the Javascript data the works?
What is different between your
dynamic_columns
when you use JSON data versus javascript data?Maybe you can post an examples. Better yet maybe a test case.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevni