Getting oColumn undefined but table seems alright!

Getting oColumn undefined but table seems alright!

crazycoderscrazycoders Posts: 6Questions: 0Answers: 0
edited February 2010 in General
$(document).ready(function(){
$('#tabs').tabs();
$('.datatable').dataTable({
"bPaginate": true,
"bLengthChange": true,
"bFilter": false,
"bSort": true,
"bInfo": true,
"bAutoWidth": false,
"sPaginationType": "full_numbers",
"sDom": '<"top"lp>rt<"clear">',
"iDisplayLength": 50,
"oLanguage": {
"sUrl": "../../res/content/datatable.fr-CA.php"
}
});

});








Op

Replies

  • crazycoderscrazycoders Posts: 6Questions: 0Answers: 0
    Note i did not paste all the code, the page works fine by default, but my datatables doesn't seem to initiate!

    I took the code (libs and table) from another page that works... i'm a little bit dumbstruck!
  • crazycoderscrazycoders Posts: 6Questions: 0Answers: 0
    Finaly, after removing and commenting and adding stuff for an hour i found out that i had another table in the code that was classed "datatable" and the Jquery selector was it, but it was NOT a datatable therefore i had that oColumn is undefined cryptic error but it had nothing to do with the actual datatables!
  • crazycoderscrazycoders Posts: 6Questions: 0Answers: 0
    Allan, maybe putting a custom error message instead of failing silently would be appreciated...

    For exemple, if a table doesn't feature THs or something like that, gracefully continue working and alert the user that table #ID something doesn't conform, it will make us lose much less time to debug stupid errors like that are not your fault at all!
  • allanallan Posts: 63,161Questions: 1Answers: 10,406 Site admin
    The thing is that initialising multiple tables with a single selector is quite useful: http://datatables.net/examples/basic_init/multiple_tables.html . However, I agree - perhaps adding the id (if there is one) would be quite useful. Added to the 'to do' list.

    Regards,
    Allan
This discussion has been closed.