Saving several datatables in a single file

Saving several datatables in a single file

KarltonKarlton Posts: 2Questions: 0Answers: 0
edited June 2010 in TableTools
Hi,

I have several dataTables in one page, is it possible to save all dataTables in a single csv/xls file with dataTools ?

I try to merge all datas in my first oTable before saving, it's work but I lose headers of the others oTable.
Something like that :
[code]
$("div.TableTools").mouseenter(function() {
for(i=1; i < oTable.length; i++) {
oTable[0].fnAddData(oTable[i].fnGetData());
}
});
[/code]

Any idea? Perhaps change fnGetDataTablesData in DataTools to merge all datas...
Thanks

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Hi Karlton,

    There isn't a built-in method for doing what you are looking for, but it certainly should be possible by hacking around with the source code. fnGetDataTablesData is a good place to start - although possibly more likely the caller for it. You could call fnGetDataTablesData for each of your tables (you'll need a reference to each) and then just concatenate the returned strings together before passing to Flash. This kind of thing should be a little easier in TableTools 2... :-)

    Regards,
    Allan
  • KarltonKarlton Posts: 2Questions: 0Answers: 0
    Thanks Allan,

    Exactly what I was thinking to do (waiting TableTools 2 ;-)
    Congratulations for Datatable, very good job!

    Best regards,
    Karl
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Hi Karl,

    If you fancy giving TableTools 2 a whirl let me know ( http://datatables.net/contact ). It's more or less ready as code, but there is next to no documentation for for it yet (other than comments) and I might rejig a few things...

    Regards,
    Allan
This discussion has been closed.