Is there a simple way to "reload" a data table that is already initialized? For example: I am using a data table on a web page that then makes a database update then reloads the whole page. Therefore, the page has retrieved new data after the update and I want to reload the table. I have tried the bDestroy but it appears to change the table formatting on the page. Here is my code - please point me in the proper direction so I may reload the table. I am using an AJAX call and have retrieved the data back before the code below is executed. Thank you for your help.
$('#test').dataTable( {
"bDestroy": true,
"aaData": msg.requests ,
"aoColumns": [
{ "mData": "tourStart" },
{ "mData": "tourEnd" },
{ "mData": "expire" },
{ "mData": "rangeStart" },
{ "mData": "rangeEnd" },
{ "mData": "lTour" },
{ "mData": "sTour" },
{ "sDefaultContent": "",
"fnRender": function( oObj ) {
return '<input type="image" class="ui-icon ui-icon-circle-check" />';
}
}
],
"sPaginationType": "full_numbers",
"iDisplayLength": 5,
"aLengthMenu": [[5, 10], [5, 10]],
"aoColumnDefs": [
{ 'bSortable': false, 'aTargets': [ 7 ] }
],
"bFilter": false,
"bProcessing": true
} );
$('#test').dataTable( {
"bDestroy": true,
"aaData": msg.requests ,
"aoColumns": [
{ "mData": "tourStart" },
{ "mData": "tourEnd" },
{ "mData": "expire" },
{ "mData": "rangeStart" },
{ "mData": "rangeEnd" },
{ "mData": "lTour" },
{ "mData": "sTour" },
{ "sDefaultContent": "",
"fnRender": function( oObj ) {
return '<input type="image" class="ui-icon ui-icon-circle-check" />';
}
}
],
"sPaginationType": "full_numbers",
"iDisplayLength": 5,
"aLengthMenu": [[5, 10], [5, 10]],
"aoColumnDefs": [
{ 'bSortable': false, 'aTargets': [ 7 ] }
],
"bFilter": false,
"bProcessing": true
} );