i want to recalc and adjust my datatable after changing the dimensions of the table by a click event.
Adjusting and recalc the table without a callback works, but the content do a kind of "flipping" so first the old dimensions are visible and after the adjustment it flips to the new dimension. To prevent this, i want to add a overlay or hide the table on the start and show it again if the adjustment has done. At this point i going crazy.
Heres my code
//This works already
$(#mytableid).DataTable().columns.adjust().responsive.recalc();
//Now i want to add a callback and hide/show the tabele
$(#mytableid).addclass('hide');
//This code failed (also by useing .DataTable)
$(#mytableid).dataTable( {
"drawCallback": function( settings ) {
alert( 'now its time to show again' );
$(#mytableid).removeclass('hide');
}
} ).columns.adjust().responsive.recalc();
I recieved the error DataTables warning: table id=mytableid - Cannot reinitialise DataTable.
How i can use a callback for this or may there is another or easier way to do it?
Thanks a lot!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…