Calling TableTools native print function from custom print function

Calling TableTools native print function from custom print function

bcarstobcarsto Posts: 1Questions: 0Answers: 0
edited April 2014 in TableTools
I have registered my own print function via aButtons as follows, Then give the options to my dataTable.

options["oTableTools"] = {
"aButtons": [
{ "sExtends": "copy", "mColumns": mColumns },
{ "sExtends": "xls", "mColumns": mColumns },
{ "sExtends": "pdf", "mColumns": mColumns },
{ "sExtends": "print",
"fnClick": function(nButton, oConfig, oFlash) {
dataTable.fnSetColumnVis(mColumns.length, false);
// call TableTools._fnPrintStart
// call TableTools.fnPrint
$(window).keyup(function() {
dataTable.fnSetColumnVis(mColumns.length, true);
// ca;; TableTools._fnPrintEnd();
});
}
}
]
};


My print function is called, but I want to call into TableTools native fnPrint to allow it to do what it does to prep the table for printing.
Then when esc is called I want to call into _fnPrintEnd to restore the DOM. My question is how do I call TableTools native print functions from my custom print function.

thanks in advance,
bob

Replies

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin
    Use the fnPrint API method: http://datatables.net/extras/tabletools/api#fnPrint .

    There is no public API to programmatically end the print at the moment.

    Allan
This discussion has been closed.