Table Tools problem with Post Load data?
Table Tools problem with Post Load data?
mstew
Posts: 7Questions: 0Answers: 0
I have run the debugger on my specific instance (epoqaj) of dataTable where I build my data from an ajax request and then format that data for dataTable using the following code:
[code] function forDataTable(jsonArray){
var cols = getCols(jsonArray);
var tableCols = new Array();
for(c in cols){
tableCols.push({"sTitle":cols[c]});
}
var dataArray = new Array();
dataToArray(dataArray, jsonArray, cols);
return {
"aaData": dataArray,
"aoColumns": tableCols,
"bDestroy": true,
"sDom": 'T<"clear"><"H"lfr>t<"F"ip>',
"oTableTools": {
"sSwfPath": "/mold_demo2/scripts/TableTools/swf/copy_csv_xls_pdf.swf"
}
}
} [/code]
The object returned from this function is then passed directly into dataTable. I am just beginning to implement the Table Tools because of a request for export and have never had this feature working. The links appear (although not as buttons) and the print button does something but does not include the print dialog (at least not in chrome). I have checked all of the calls and note that none have 404s.
Can anyone help me get my exports working?
Please and thank you,
Michelle
[code] function forDataTable(jsonArray){
var cols = getCols(jsonArray);
var tableCols = new Array();
for(c in cols){
tableCols.push({"sTitle":cols[c]});
}
var dataArray = new Array();
dataToArray(dataArray, jsonArray, cols);
return {
"aaData": dataArray,
"aoColumns": tableCols,
"bDestroy": true,
"sDom": 'T<"clear"><"H"lfr>t<"F"ip>',
"oTableTools": {
"sSwfPath": "/mold_demo2/scripts/TableTools/swf/copy_csv_xls_pdf.swf"
}
}
} [/code]
The object returned from this function is then passed directly into dataTable. I am just beginning to implement the Table Tools because of a request for export and have never had this feature working. The links appear (although not as buttons) and the print button does something but does not include the print dialog (at least not in chrome). I have checked all of the calls and note that none have 404s.
Can anyone help me get my exports working?
Please and thank you,
Michelle
This discussion has been closed.
Replies
PS: The tableTools are still not displaying, but the newest debug link for my data is: ihaneb
I know it should be [code]
var oTable = $('#example').dataTable();
// Immediately 'nuke' the current rows (perhaps waiting for an Ajax callback...)
oTable.fnClearTable();
[/code]
But everytime I do that (with any function) I get errors on the oTable.fn.... line
What am I doing wrong?
Allan
Thank you