fnSort - Cannot read property 'className' of undefined
fnSort - Cannot read property 'className' of undefined
nml5566
Posts: 1Questions: 0Answers: 0
I'm not actually sure if I stumbled upon a bug or not, but I wanted to bring this to everyone's attention since I couldn't find anything about it in the forum aside from a previous bug fix last month.
I wrote bit of javascript to draw separate sort buttons and arrows above the datatable, which call fnSort() whenever a user adds, deletes, or modifies them. Unless I explicitly set bSortClasses to false, I get the following stack trace error message:
Uncaught TypeError: Cannot read property 'className' of undefined
_fnSortingClasses......................................jquery.dataTables.js:4947
_fnSort.......................................................jquery.dataTables.js:4663
$.fn.dataTable.fnSort.................................jquery.dataTables.js:1596
fnSortDir.............................................................................test.js:72
sort_img.onclick..................................................................test.js:10
Since I don't use sort classes anyway, and honestly don't know what they're supposed to do, I just turned it off. But I'm assuming this isn't the desired behavior. I'm not doing anything special with the sort array, just passing example data like what's shown on the API page. Here's my table initialization if it helps:
[code]
var oTable = \$('.datatables').dataTable( {
"oLanguage": {
"sProcessing": "Loading...",
"sInfo": "Showing _START_ to _END_ of _TOTAL_ entries ($searchtime)",
"sLengthMenu": 'Display '
+ '10'
+ '20'
+ '50'
+ '100'
+ '200 results'
},
"fnPreDrawCallback": function (oSettings) {
\$('#bottom_process').css('visibility','visible');
},
"fnDrawCallback": function (oSettings) {
\$('#bottom_process').css('visibility','hidden');
},
"bSortClasses": false,
"sPaginationType": "full_numbers",
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "$cgibin/tablemaker",
"iDeferLoading": '$entries',
"sDom": '<"top"p>r<"giveHeight"t><"bottom"lp><"clear">'
} );
[/code]
I wrote bit of javascript to draw separate sort buttons and arrows above the datatable, which call fnSort() whenever a user adds, deletes, or modifies them. Unless I explicitly set bSortClasses to false, I get the following stack trace error message:
Uncaught TypeError: Cannot read property 'className' of undefined
_fnSortingClasses......................................jquery.dataTables.js:4947
_fnSort.......................................................jquery.dataTables.js:4663
$.fn.dataTable.fnSort.................................jquery.dataTables.js:1596
fnSortDir.............................................................................test.js:72
sort_img.onclick..................................................................test.js:10
Since I don't use sort classes anyway, and honestly don't know what they're supposed to do, I just turned it off. But I'm assuming this isn't the desired behavior. I'm not doing anything special with the sort array, just passing example data like what's shown on the API page. Here's my table initialization if it helps:
[code]
var oTable = \$('.datatables').dataTable( {
"oLanguage": {
"sProcessing": "Loading...",
"sInfo": "Showing _START_ to _END_ of _TOTAL_ entries ($searchtime)",
"sLengthMenu": 'Display '
+ '10'
+ '20'
+ '50'
+ '100'
+ '200 results'
},
"fnPreDrawCallback": function (oSettings) {
\$('#bottom_process').css('visibility','visible');
},
"fnDrawCallback": function (oSettings) {
\$('#bottom_process').css('visibility','hidden');
},
"bSortClasses": false,
"sPaginationType": "full_numbers",
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "$cgibin/tablemaker",
"iDeferLoading": '$entries',
"sDom": '<"top"p>r<"giveHeight"t><"bottom"lp><"clear">'
} );
[/code]
This discussion has been closed.