( changing the content and the column structure).
Unfortunately I couldn't find a way to do it in one go.
There is the table.fnDestroy(true);
but this removes the <table>
element from the page as well.
We could use this but then we need to wrap the table element in a div in order to have a place where to
recreate the table.
It seem easyer to:
table.fnClearTable(); // clear all the rows ( not really necessary since we call empty() at the end)
table.fnDestroy(); // remove table enhancements
$('#theTable').empty() // empty the table content ( this remove the rows)
table = $('#theTable').dataTable(config); // recreate the table with the new configuration
I am not able to use table.fnClearTable(); table.fnDestroy(); $('#theTable').empty()
I am required to use the refreshing of datatable as when i use blank text box in search then all data should be displayed