fnGetTableData function doesn't get all data that i insert after drawCallBack() !
fnGetTableData function doesn't get all data that i insert after drawCallBack() !
erykose
Posts: 2Questions: 0Answers: 0
in TableTools
I grouped my row with the codes in datatable example (https://datatables.net/examples/advanced_init/row_grouping.html) then i initilized TableTools and when i try to export my table to xls or csv that use fnGetTableData function, It doesnt show and export my group name row and just save without any groupname. How can i export my table after i add some row like group rowing example ?
This discussion has been closed.
Replies
See the append FAQ.
In short, you need to use the API if you want to add data TableTools will see.
Allan
"drawCallback": function ( settings ) {
var api = this.api();
var rows = api.rows( {page:'current'} ).nodes();
var last=null;
api.column(2, {page:'current'} ).data().each( function ( group, i ) {
if ( last !== group ) {
$(rows).eq( i ).before(
'<tr class="group"><td colspan="5">'+group+'</td></tr>'
);
last = group;
}
} );
}
in this codes for the lines :
$(rows).eq( i ).before(
'<tr class="group"><td colspan="5">'+group+'</td></tr>'
);
how can i do this with api.row.add() ?