fnAddData and tabletools not working

fnAddData and tabletools not working

TrapiasTrapias Posts: 3Questions: 0Answers: 0
edited February 2014 in TableTools
Hello,
I'm populating my datatable clientside with a custom array of objects: I load a json array from ajax and then manipulate data via fnServerData, where my success function builds an array of cutom columns, and adds rows calling fnAddData.
Something like:

[code]
...
"fnServerData": function( sSource, aaData, fnCallback, oSettings){
oSettings.jqXHR = $.ajax( {
"dataType": 'json',
"type": "GET",
"url": sSource,
"success": function( aaData){
populate(aaData);
}
...
//then in populate I call fnAddData for each row I want to add
mytable.fnAddData(jsondata,true);
[/code]


This is working pretty good, except TableTools is not working: I can see the buttons and all formatting is ok, but the only working button is PRINT; Copy only puts "blank" in clipboard, while csv/excelpdf buttons do absolutely nothing - but I see no errors.
I'm using datatables 1.9.4 and tried both the TableTools that comes with it and the new 2.2.0: apart some changes in look I cannot see any difference, only the print button works.

Afaik it's not a problem with the swf path, since I can see buttons. I think I'm missing something else, but what?
Maybe populating the table client-side (bProcessing false, bServerSide false) with fnAddData requires some additional call when I'm done, to tell tabletools to update its view of data?
Thanks for any suggestion,
al.

Replies

  • upreethamupreetham Posts: 2Questions: 0Answers: 0
    I am having the same problem. After calling fnAddData, the tabletools Select multi rows is not working. How can I solve this problem?
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Can you link to a test case showing the issue please? There shouldn't be a problem using fnAddData with the row selection options in TableTools.

    Allan
  • upreethamupreetham Posts: 2Questions: 0Answers: 0
    But After digging though the forum (which is amazing!) more I did the following two steps to solve the problem:

    1. Updated the tabletools library from 2.1.4 to 2.2.0
    2. Also the tabletools library 2.2.0 had an issue with duplicate declaration, after fixing this

    The fnAddData and tabletools worked just great.

    Thanks for all the support and the libraries.
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Cool - good to hear. 2.2.1 is going to be released soon!

    Allan
This discussion has been closed.