print Data Table without using oTableTools initialization param
print Data Table without using oTableTools initialization param
readylee
Posts: 6Questions: 0Answers: 0
Hi,
I would like to make use of Table Tools print functionality for making a print view of my DataTables table(s), but I am using custom buttons already. In fact the only functionality that I need from the TableTools plugin: Print.
If (Allan) you would be so kind as to forward the Print.js that you mentioned in this thread...: http://datatables.net/forums/comments.php?DiscussionID=3726&page=1
...it would probably help me immediately, from what I've gathered.
Otherwise, if anyone can offer some guidance as to how I can simply render a Print view of my Data Table(s) via a button click event, it would be greatly appreciated. Again, rendering my buttons via [code] oTableTools : { "aButtons": [copy,print ... ] } [/code] won't really be helpful. I need to create my toolbar buttons differently, but I do need for one of them to render a Printable view of the table (once it's clicked).
By the way; DataTables is some kind of wonderful... I look forward to other applications (in other applications)!
I would like to make use of Table Tools print functionality for making a print view of my DataTables table(s), but I am using custom buttons already. In fact the only functionality that I need from the TableTools plugin: Print.
If (Allan) you would be so kind as to forward the Print.js that you mentioned in this thread...: http://datatables.net/forums/comments.php?DiscussionID=3726&page=1
...it would probably help me immediately, from what I've gathered.
Otherwise, if anyone can offer some guidance as to how I can simply render a Print view of my Data Table(s) via a button click event, it would be greatly appreciated. Again, rendering my buttons via [code] oTableTools : { "aButtons": [copy,print ... ] } [/code] won't really be helpful. I need to create my toolbar buttons differently, but I do need for one of them to render a Printable view of the table (once it's clicked).
By the way; DataTables is some kind of wonderful... I look forward to other applications (in other applications)!
This discussion has been closed.
Replies
There are two options off the top of my head for this situation:
1. Create the button using oTableTools as normal, but then move it using standard DOM / jQuery manipulation, to wherever you want it on the page.
2. You could hook into the private methods in TableTools and activate the print functions whenever your event handlers need. Probably not to hard to do, but you'd need to fish around in the TableTools code a little (have a look at fnClick for the 'print' button definition.
Allan
Again, thank you very much for your (rapid) response...
Good to hear that does the job.
Allan