Table tools return "undefined" data while exporting.

Table tools return "undefined" data while exporting.

vshahvshah Posts: 2Questions: 0Answers: 0
edited April 2014 in TableTools
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...

Replies

  • vshahvshah Posts: 2Questions: 0Answers: 0
    Can someone help me in this matter?



    Thanks in advance...
  • crunchfactorycrunchfactory Posts: 29Questions: 8Answers: 2

    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?

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    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 the oParams variable, what does it contain?

    Allan

This discussion has been closed.