"columnDefs" not working properly...
"columnDefs" not working properly...
gur_carn
Posts: 10Questions: 2Answers: 0
Hi,
My aim is to implement row_grouping model to my datatable.
Once the page shows up it hides the column, after the data initilized and drawn, the hidden column shows up again.
Dom js function code;
var table = $('#example').dataTable( {
responsive: true,
"ajax": str,
"pagingType": "full",
"displayLength": 25,
"drawCallback": function ( settings ) {
var api = this.api();
var rows = api.rows( {page:'current'} ).nodes();
var last=null;
api.column(0, {page:'current'} ).data().each( function ( group, i ) {
if ( last !== group ) {
$(rows).eq( i ).before(
'<tr class="group"><td colspan="7">'+group+'</td></tr>'
);
last = group;
}
} );
},
"columnDefs": [
{ "targets": 0, "visible": false }
],
} );
I realised that ; the reason is " responsive propertry does not allow it:..."
Is there a way using it together...
Thanks in advance
This discussion has been closed.
Answers
solved
http://datatables.net/examples/ajax/objects.html
Thanks