Tabletools fails to load new data when dataTables is recreated, errors on inserting data into rows

Tabletools fails to load new data when dataTables is recreated, errors on inserting data into rows

mattduncan13mattduncan13 Posts: 1Questions: 0Answers: 0
edited February 2014 in TableTools
Using DataTables 1.9 with TableTools 2.2.0

The initialization of datatable and tabletools:

[code]
var reportTable = $('#recipientDetails').dataTable(
{
"bDestroy": true,
"sDom": 'T<"clear">lfrtip',
"aaData": realData.recipientDetails,
"oTableTools": {
"sSwfPath": '/common/flash/copy_csv_xls.swf',
"aButtons": [
{
"sExtends": "copy",
"sButtonText": "Copy to clipboard"
},
{
"sExtends": "csv",
"sButtonText": "Save to CSV"
},
{
"sExtends": "xls",
"sButtonText": "Save for Excel"
}
]
},
"aoColumns": [
{ 'sTitle': 'user id', 'mData': 'name' },
{ 'sTitle': 'Address Sent To', 'mData': 'addresses' },
{ 'sTitle': 'Text Confirmation', 'mData': 'gotText' },
{ 'sTitle': 'Voice Confirmation', 'mData': 'gotVoice' },
{ 'sTitle': 'Email Confirmation', 'mData': 'gotEmail' },
{ 'sTitle': 'Response', 'mData': 'lastResponse' },
{ 'sTitle': 'Date of Response', 'mData': 'lastResponseDate' }
],
'aoColumnDefs': [
{
'mRender': function (addressData, type, row) {
var dstring = "";
for (var p = 0; p < addressData.length; p++) {
dstring = dstring + addressData[p] + '';
}
return dstring;
},
'aTargets': [1]
},
{
'aTargets': [2],
'mRender': function (textRecip, type, row) {
if (textRecip.length > 0 && msgDetails.text.content != null)
return confirmHelper(textRecip, false);
return 'N/A';
}
},
{
'aTargets': [3],
'mRender': function (voiceRecip, type, row) {
if (voiceRecip.length > 0 && msgDetails.voice.content != null)
return confirmHelper(voiceRecip, false);
return 'N/A';
}
},
{
'aTargets': [4],
'mRender': function (emailRecip, type, row) {
if (emailRecip.length > 0)
return confirmHelper(emailRecip, true);
return 'N/A';
}
}
]
})
[/code]

The table is initialized when a report, selected from a list of reports, is viewed. The data for the table is determined by which report is chosen as well. The datatable is re-initialized(with bDestroy) when a new report is viewed -- so the page does not refresh, the above code is just re-run with new data.

The first time the table is initialized everything works fine. However if I re-initialize on with a different report that has more rows than the previous tabletools errors out:

[code]
Line #2073 dataTables.tableTools.js

for ( j=0, jLen=aDataIndex.length ; j
This discussion has been closed.