How can I programmatically close the print view?
How can I programmatically close the print view?
edtd
Posts: 4Questions: 0Answers: 0
Is there a way to programmatically close the print view and return to the normal view? I found the _fnPrintEnd() function, but I'm not sure how I can call it from my DataTable object...
This discussion has been closed.
Replies
Regards,
Allan
Allan, seems i found some wrong behavior in TableTools:
i have datatble (#pricelist) with
[code]
"sDom" : 'rt<"table_length"l>i<"pagination"p>',
[/code]
when i initialize Tabletools like
[code]
oTable = $('#pricelist').dataTable({...});
var oTableTools = new TableTools( oTable, {
"aButtons": [
{
"sExtends": "xls",
"sButtonText": "<?=__("HP Button0083")?>"
}
, {
"sExtends": "print"
, "bShowAll": false
, "sMessage": ''
, "fnClick": function ( nButton, oConfig, oFlash ) {
$('#print_head').html($('#print_head_hidden').html());
}
}
],
"sSwfPath": "/images/copy_cvs_xls.swf"
});
[/code]
and after i just append it to my table
[code]
$('#xls').append( oTableTools.dom.container );
[/code]
It Works fine, but when i want to add some button to print_preview , using
[code]
TableTools.fnGetInstance('pricelist')._fnPrintEnd(true);
[/code]
i have nothing. Seems, if I don't use T in sDom i can't get
instance of my table via
[code]
var TableTools1 = TableTools.fnGetInstance( 'example1' );
[/code]
This return null, because (investigated it)
[code]
TableTools._aInstances.length
[/code]
equal 0...
What you mean about it. I did something wrong or it's a bug of plugin?
By the way, thank you for your good thing that you made!
[code]
oTableTools._fnPrintEnd(e)
[/code]
Not sure that it is so right way, but it is works fine =)
Allan