a.aoColumns[e] is undefined
a.aoColumns[e] is undefined
JustinTime
Posts: 4Questions: 0Answers: 0
Hey there,
I have a problem which I cannot seem to find the solution for. In short, I have set a specific column I want to sort by "num-html" using the DataTables plugin here: http://datatables.net/plug-ins/sorting#numbers_html
I have included this code at the top of my JS file and set the sorting for this column through aoColumns in the DataTables initialization. Here is my initialization:
[code]
results_table = $('#course_results').dataTable({
"bInfo": true,
"sPaginationType": "full_numbers",
"bRetrieve": true,
"aoColumnDefs": [ { "bSortable": false, "aTargets": [ 2, 3, 4 ] } ],
"aoColumns": [
null,
null,
null,
null,
null,
null,
{ "sType": "num-html" }
]
});
[/code]
The sorting on my 7th column works fine, but when I try to sort by my 4th column (which I am sorting manually with hidden columns) I get this error in Firebug (on Firefox 4):
a.aoColumns[e] is undefined
http;//vps.pottersschool.net/Behavior/js/jquery.dataTables.min.js - Line 82
If I remove the aoColumns piece from my DataTables initialization, however, my 4th column sorts fine. However, the 7th column does not sort in the way I need it to. I am not sure why this is occuring. Perhaps I am missing something silly, but I really have no clue.
You can view my page here: http://vps.pottersschool.net/Structure/courses_page.html
Any help would be greatly appreciated! Let me know if you need anything else before you can help me. Thanks!
-Justin
I have a problem which I cannot seem to find the solution for. In short, I have set a specific column I want to sort by "num-html" using the DataTables plugin here: http://datatables.net/plug-ins/sorting#numbers_html
I have included this code at the top of my JS file and set the sorting for this column through aoColumns in the DataTables initialization. Here is my initialization:
[code]
results_table = $('#course_results').dataTable({
"bInfo": true,
"sPaginationType": "full_numbers",
"bRetrieve": true,
"aoColumnDefs": [ { "bSortable": false, "aTargets": [ 2, 3, 4 ] } ],
"aoColumns": [
null,
null,
null,
null,
null,
null,
{ "sType": "num-html" }
]
});
[/code]
The sorting on my 7th column works fine, but when I try to sort by my 4th column (which I am sorting manually with hidden columns) I get this error in Firebug (on Firefox 4):
a.aoColumns[e] is undefined
http;//vps.pottersschool.net/Behavior/js/jquery.dataTables.min.js - Line 82
If I remove the aoColumns piece from my DataTables initialization, however, my 4th column sorts fine. However, the 7th column does not sort in the way I need it to. I am not sure why this is occuring. Perhaps I am missing something silly, but I really have no clue.
You can view my page here: http://vps.pottersschool.net/Structure/courses_page.html
Any help would be greatly appreciated! Let me know if you need anything else before you can help me. Thanks!
-Justin
This discussion has been closed.
Replies
[code]
DataTables warning (table id = 'course_results'): Unexpected number of TD elements. Expected 126 and got 252. DataTables does not support rowspan / colspan in the table body, and there must be one cell for each row/column combination.
[/code]
aoColumns must be the same length as the number of columns defined in the HTML. You can use bVisible to hide columns if you need to.
Allan
-Justin