Error after clearing datatable using fnClearTable()

Error after clearing datatable using fnClearTable()

codemonkey65codemonkey65 Posts: 14Questions: 3Answers: 0
edited July 2012 in DataTables 1.8
The first time I retrieve data into my datatable, everything works according to my expectations. After I clear the page (including several html controls) and reset to my defaults, I attempt a second display of data and receive the following error: 'Unable to get value of the property 'toLowerCase': object is null or undefined'

My code to fill the grid uses the following code:

$('#divLoadingData').html('');
$('#grdLoadingData').dataTable({
"bLengthChange": false,
"bPaginate": true,
//"bJQueryUI": true,
"sPaginationType": "full_numbers",
"aaData": records,
"sDom": "T<'clear'>lfrtip",
"oTableTools": {
"sRowSelect": "multi"
},
"bAutoWidth": false,
"aoColumns": [
{ "sTitle": "MC #", "sWidth": "40px" },
{ "sTitle": "Order #", "sWidth": "40px" },
{ "sTitle": "Site", "sWidth": "25px" },
{ "sTitle": "Seq. #", "sWidth": "15px" }...

{ "sTitle": "DepartureDate", "sWidth": "0px" },
{ "sTitle": "GroupingValue", "sWidth": "0px" }
]
}).rowGrouping({
bExpandableGrouping: true,
iGroupingColumnIndex: 52
}); ;
hideColumns(view.val());

}

On click of my 'CLEAR' button the following code is executed:

var loadingDataTable = $('#grdLoadingData').dataTable();
loadingDataTable.fnClearTable();

After I clear the page, I try to generate a new grid and receive the error mentioned above.

Can anyone help, please?

Replies

  • koosvdkolkkoosvdkolk Posts: 169Questions: 0Answers: 0
    Can you provide an example on http://live.datatables.net

    Makes live easier :)
  • codemonkey65codemonkey65 Posts: 14Questions: 3Answers: 0
    Unfortunately the page this error is occurring on is very large and pushing it all out to live.datatables.net might prove difficult. I will try to condense the material so that the error is reproducable in a smaller code sample. In the mean time, if anyone else has any thoughts on this I would appreciate any feedback.
  • codemonkey65codemonkey65 Posts: 14Questions: 3Answers: 0
    I discovered my issue and it was completely unrelated to the datatables. It ended up being a hidden value that was not being reset properly when I cleared the page so that when I tried to rebind to my datatable the parameters sent to retrieve the data were wrong and the data didn't include the correct grouping information. Thanks for taking the time to reply to my request.
This discussion has been closed.