print preview in a popup
print preview in a popup
shawnrummel
Posts: 3Questions: 0Answers: 0
I am a newby with JQuery and am trying to figure out how to create a print preview using the Table Tools plugins 'Print' functionality. As is the print functionality removes non-printing elements. I have a requirement to display that same representation in a pop-up. If I just use DOM manipulation I only get the first page of my dataTable. I would like the print preview in the pop-up to show all results.
This discussion has been closed.
Replies
Allan
[code]
function tablePrint(tableElement, tableId){
var oSetDT = tableElement.s.dt;
var oSetPrint = tableElement.s.print;
tableElement.s.print.saveStart = oSetDT._iDisplayStart;
tableElement.s.print.saveLength = oSetDT._iDisplayLength;
oSetDT._iDisplayStart = 0;
oSetDT._iDisplayLength = -1;
oSetDT.oApi._fnCalculateEnd( oSetDT );
oSetDT.oApi._fnDraw( oSetDT );
var tableToPrint = $('#'+tableId);
tableToPrint.jqprint();
$('#printFrame').hide();
oSetDT._iDisplayStart = oSetPrint.saveStart;
oSetDT._iDisplayLength = oSetPrint.saveLength;
oSetDT.oApi._fnCalculateEnd( oSetDT );
oSetDT.oApi._fnDraw( oSetDT );
}
[/code]
I am now working on getting Headers and Footers included.