I am using datatables in a jquery UI dialog. Below is the function I am calling to draw the table whenever the dialog is opened.
Within the dialog I have another button, which calls the same function, with new filter. And I do get the new data set on table.
Problem is- new data set is not clickable at bottom rows. I tried to debug and got an error at following function in TableTools.js because TableTools still has old data set in variable "this.s.dt.aoData".
Please help me know how will TableTools be reinitialized whenever new data set is brought in the datatable.
function listPtCharges(filter){ var chgTable; chgTable = $('#chargeTable').dataTable({ "bJQueryUI": true, "bDestroy": true, "sDom": 'tT', "bSort": false, "bAutoWidth": false, "sAjaxSource": "/ajax/ptchglist.php", "fnServerData": function ( sSource, aoData, fnCallback ) { aoData.push( { "name": "filter", "value": filter } ); $.ajax( { "dataType" : 'json', "type" : "POST", "url" : sSource, "data" : aoData, "success" : fnCallback } ); } , "aoColumns": [ {"bVisible":false}, {"sWidth": 55}, {"sWidth": 30} ], "oTableTools": { "sRowSelect": chgSelctionTyp, "sSwfPath": "/swf/copy_csv_xls_pdf.swf", "aButtons": [] } }); }
Within the dialog I have another button, which calls the same function, with new filter. And I do get the new data set on table.
Problem is- new data set is not clickable at bottom rows. I tried to debug and got an error at following function in TableTools.js because TableTools still has old data set in variable "this.s.dt.aoData".
"fnIsSelected": function ( n ) { var pos = this.s.dt.oInstance.fnGetPosition( n ); return (this.s.dt.aoData[pos]._DTTT_selected===true) ? true : false; },
Please help me know how will TableTools be reinitialized whenever new data set is brought in the datatable.