tabletools print
tabletools print
remsy
Posts: 10Questions: 0Answers: 0
Hi. Is it possible to print preview in another browser window/tab? People tend to hit the back button instead of ESC to leave print preview mode.
thanks
thanks
This discussion has been closed.
Replies
If somebody have a clue.
( I'm looking at the way of putting a button at the top/bottom of my tab and instead of pressing esc press this button )
ps: sorry for my (bad) english.
Allan
[code]
Retour
[/code]
And in a .js include I've put :
[code]
var printEnd = function(datatableName, bouttonDiv) {
/* TableTools.fnGetInstance('traitement')._fnPrintEnd(e); */
var that = TableTools.fnGetInstance(datatableName);
var oSetDT = TableTools.fnGetInstance(datatableName).s.dt;
var oSetPrint = TableTools.fnGetInstance(datatableName).s.print;
var oDomPrint = TableTools.fnGetInstance(datatableName).dom.print;
/* Show all hidden nodes */
TableTools.fnGetInstance(datatableName)._fnPrintShowNodes();
/* Restore DataTables' scrolling */
if ( oSetDT.oScroll.sX !== "" || oSetDT.oScroll.sY !== "" )
{
TableTools.fnGetInstance(datatableName)._fnPrintScrollEnd();
}
/* Restore the scroll */
window.scrollTo( 0, oSetPrint.saveScroll );
/* Drop the print message */
if ( oDomPrint.message !== null )
{
document.body.removeChild( oDomPrint.message );
oDomPrint.message = null;
}
/* Styling class */
J(document.body).removeClass( 'DTTT_Print' );
/* Restore the table length */
oSetDT._iDisplayStart = oSetPrint.saveStart;
oSetDT._iDisplayLength = oSetPrint.saveLength;
oSetDT.oApi._fnCalculateEnd( oSetDT );
oSetDT.oApi._fnDraw( oSetDT );
J(document).unbind( "keydown", TableTools.fnGetInstance(datatableName).s.print.funcEnd );
TableTools.fnGetInstance(datatableName).s.print.funcEnd = null;
J('#' + bouttonDiv).addClass("hide");
};
[/code]
It's working well but if you do something to TableTool it should be better of course. Waiting for that this solution is not too bad ( and not instrusive, I've disabled the escape key manualy to keep the control on the "back div" but it should be good to put a parameter to the print method to disable de Escape key).
Is it possible to know when you want to put the "Tab feature" in TableTools ?
Allan
{ "sExtends": "print",
"sMessage": "Your original message"
+ " "
}
Regards,
Ray
Is this resolved ?
--
gnumonk
Thanks!
Allan