Is the "new TableTools()" example working properly?
Is the "new TableTools()" example working properly?
wulfhart
Posts: 4Questions: 0Answers: 0
I searched for an answer, but couldn't find one on the forum or google
I was troubleshooting an issue where changing buttons during setup wouldn't change what was displayed and found the same problem on the example page.
The example is here http://datatables.net/release-datatables/extras/TableTools/alt_init.html
The initialization for the example page is:
[code]
$(document).ready( function () {
var oTable = $('#example').dataTable();
var oTableTools = new TableTools( oTable, {
"buttons": [
"copy",
"csv",
"xls",
"pdf",
{ "type": "print", "buttonText": "Print me!" }
]
} );
$('#demo').before( oTableTools.dom.container );
} );
[/code]
However, it displays the 5 default buttons without a customized "print" button. The "Print" button does not say "Print me!" as was specified in setup.
Is this an error or am I mistaken?
I was troubleshooting an issue where changing buttons during setup wouldn't change what was displayed and found the same problem on the example page.
The example is here http://datatables.net/release-datatables/extras/TableTools/alt_init.html
The initialization for the example page is:
[code]
$(document).ready( function () {
var oTable = $('#example').dataTable();
var oTableTools = new TableTools( oTable, {
"buttons": [
"copy",
"csv",
"xls",
"pdf",
{ "type": "print", "buttonText": "Print me!" }
]
} );
$('#demo').before( oTableTools.dom.container );
} );
[/code]
However, it displays the 5 default buttons without a customized "print" button. The "Print" button does not say "Print me!" as was specified in setup.
Is this an error or am I mistaken?
This discussion has been closed.
Replies
Sorry about that.
Allan
I redid the example here http://live.datatables.net/aninuf/4/edit
I changed it to sType and sButtonText, but nothing changed. I then removed both the "print" button and "xls" button. It still displayed 5 default buttons.
Further experiment showed that if I modify TableTools.DEFAULTS.aButtons the buttons will change, but this doesn't seem like the proper method of customizing buttons.
And I think sExtends rather than sType... That example didn't really go very well did it... :-(
Allan
It works great now. Thank you very much.
http://live.datatables.net/aninuf/5/edit
Allan