Tabletools doesn't work
Tabletools doesn't work
drakula1234
Posts: 58Questions: 1Answers: 0
I am trying to use tabletools plugin for the datatables I already have. I have included zeroclipboard.js and also the tabletools.min.js file in my jsp page. I have created a folder swf under WEB-INF and added the copy_cvs_xls_pdf.swf file in that directory. I am using
[code]
[/code] to get the path
I have included the path as
[code]
"oTableTools": {
"sSwfPath": ""
} [/code]
I don't get any errors when I look at firebug but still all the options are disabled except the print option. Any help would be greatly appreciated
[code]
[/code] to get the path
I have included the path as
[code]
"oTableTools": {
"sSwfPath": ""
} [/code]
I don't get any errors when I look at firebug but still all the options are disabled except the print option. Any help would be greatly appreciated
This discussion has been closed.
Replies
2. Look at your server's error log. I'd bet you are getting a 404 error on the swf.
Allan
Allan
I have just another problem, I need to keep the div tag, and I am trying to use your example given above, for some reason I don't get the functionality working.
I have this code, and jqTable[0] seems to be null when I try to alert it
[code]
var jqTable = $('table.display, ui.panel');
console.log(jqTable);
var oTableTools = TableTools.fnGetInstance( jqTable[0] );
if ( oTableTools != null && oTableTools.fnResizeRequired() )
{
/* A resize of TableTools' buttons and DataTables' columns is only required on the
* first visible draw of the table
*/
jqTable.dataTable().fnAdjustColumnSizing();
oTableTools.fnResizeButtons();
}
[/code]
console.log[jqTable] does print
[quote]
[prevObject: e.fn.e.init[1], context: #document, selector: "table.display, ui.panel"]
context: #document
length: 0
prevObject: e.fn.e.init[1]
selector: "table.display, ui.panel"
__proto__: Object[0]
[/quote]
Since my table id is datatablesTableID should I have to like use it like
$('datatablesTableID', ui.panel) or something like that ?
Does the debug help ? http://debug.datatables.net/okofug
I have placed some debug statements and found that oTableToolsValue is indeed null and doesn't go into the if loop
[code]
var jqTable = $('#datatablesTableID');
console.log(jqTable);
if ( jqTable.length > 0 ) {
console.log(jqTable[0]);
var oTableTools = TableTools.fnGetInstance( jqTable[0] );
console.log(oTableTools);
if ( oTableTools != null && oTableTools.fnResizeRequired() )
{
/* A resize of TableTools' buttons and DataTables' columns is only required on the
* first visible draw of the table
*/
jqTable.dataTable().fnAdjustColumnSizing();
oTableTools.fnResizeButtons();
}
}
[/code]
output for 3 console.log statements I have put
[quote]
[table#datatablesTableID]
null
[/quote]
If oTableTools in the above code is null then TableTools doesn't know what your table is. I really would need to see a working example to even stand a chance of being able to offer any more help.
Allan