I'm using this great jQuery Datatables with TableTools extension and everything works just fine except for print thing.
I have a sidebar on my page so when I click "Print", the sidebar is included on the print view which not good so what I did is hide it when the click event on the "Print" button is triggered but I don't know how to restore the sidebar again
I can use .show() and .hide() but I just don't know where to catch the event where someone exit on the print view (pressing Esc will make the print view off).
Below code is what I tried:
$(document).ready(function(){
//initialize datatables
$('#test_table').dataTable( {
"dom": 'T<"clear">lfrtip',
"tableTools": {
"sSwfPath": "/../../../plugins/datatables/extensions/TableTools/swf/copy_csv_xls_pdf.swf"
}
} );
//when they click the custom button that has a class of 'test_print' then trigger the datatables table tools button with a class of 'DTTT_button_print'
$(".test_print").click(function(){
$(".sidebar-toggle").hide(); //hide the sidebar
$(".DTTT_button_print").trigger("click"); //trigger the click event
});
});
How to catch the event where print view is turned off (when pressing Esc the print view will exit) so that I could show my sidebar back?