Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82109

tabletools not reinitiliazed after ajax reload

$
0
0
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.

  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.

Viewing all articles
Browse latest Browse all 82109

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>