Table tools return "undefined" data while exporting.
Table tools return "undefined" data while exporting.
vshah
Posts: 2Questions: 0Answers: 0
Hi ALL,
I am using Datatable with ServerSide processing and it's working perfectly. But whenever I tried to export data using Tabletool it is returning data with value "undefined". I have tried with all available versions of datatable. It is displaying below data after export :
First Name Last Name Address1 City State
undefined undefined undefined undefined undefined
undefined undefined undefined undefined undefined
Below is code...
var oTable = $('#example').dataTable({
"sPaginationType" : "full_numbers" ,
"bProcessing": true,
"bServerSide": true,
"bJQueryUI": true,
"sAjaxSource": url,
"sDom": 'lf<"clear">Trtip',
"oTableTools": {
"sSwfPath": "../DataTables-1.9.2/media/swf/copy_cvs_xls_pdf.swf",
"aButtons": [
{
"sExtends": "copy",
"sButtonText": "Copy"
},
{
"sExtends": "csv",
"sButtonText": "CSV"
},
{
"sExtends": "xls",
"sButtonText": "XLS"
},
{
"sExtends": "pdf",
"sButtonText": "PDF"
},
{
"sExtends": "print",
"sButtonText": "Print"
}
]
},
"aoColumns": [
{ "mDataProp": "firstName" },
{ "mDataProp": "lastName" },
{ "mDataProp": "address1" },
{ "mDataProp": "city" },
{ "mDataProp": "state" }
],
"fnServerData": function (sSource, aoData, fnCallback) {
$.ajax({
"dataType": 'json',
"type": "POST",
"url": sSource,
"data": aoData,
"success": fnCallback
});
}
});
Your help is highly appreciated in this matter.
Thanks...
I am using Datatable with ServerSide processing and it's working perfectly. But whenever I tried to export data using Tabletool it is returning data with value "undefined". I have tried with all available versions of datatable. It is displaying below data after export :
First Name Last Name Address1 City State
undefined undefined undefined undefined undefined
undefined undefined undefined undefined undefined
Below is code...
var oTable = $('#example').dataTable({
"sPaginationType" : "full_numbers" ,
"bProcessing": true,
"bServerSide": true,
"bJQueryUI": true,
"sAjaxSource": url,
"sDom": 'lf<"clear">Trtip',
"oTableTools": {
"sSwfPath": "../DataTables-1.9.2/media/swf/copy_cvs_xls_pdf.swf",
"aButtons": [
{
"sExtends": "copy",
"sButtonText": "Copy"
},
{
"sExtends": "csv",
"sButtonText": "CSV"
},
{
"sExtends": "xls",
"sButtonText": "XLS"
},
{
"sExtends": "pdf",
"sButtonText": "PDF"
},
{
"sExtends": "print",
"sButtonText": "Print"
}
]
},
"aoColumns": [
{ "mDataProp": "firstName" },
{ "mDataProp": "lastName" },
{ "mDataProp": "address1" },
{ "mDataProp": "city" },
{ "mDataProp": "state" }
],
"fnServerData": function (sSource, aoData, fnCallback) {
$.ajax({
"dataType": 'json',
"type": "POST",
"url": sSource,
"data": aoData,
"success": fnCallback
});
}
});
Your help is highly appreciated in this matter.
Thanks...
This discussion has been closed.
Replies
Thanks in advance...
Hi,
We're getting the exact same issue; despite listing everything in the aoPost area, our request body only contains "undefined=undefined" - any ideas here?
I'm going to need more information to be able to offer any help here I think - ideally a test case. Are you using the
download get + post
plug-in from here: https://datatables.net/extensions/tabletools/plug-ins ? If you add a debug line in to console out theoParams
variable, what does it contain?Allan