Object doesn't support property or method 'dataTable'

Object doesn't support property or method 'dataTable'

edited May 2011 in Bug reports Posts: 1
I am getting the above bug if I use jQuery-1.6 in my project. For jQuery-1.5.1 it is working fine. My code is:
$("body").ready(function () { $("#grdIntVerifyOrder").dataTable({ "bServerSide": true, "bStateSave": true, "sAjaxSource": "Internal/ticket/IntVerifyOrder", "bJQueryUI": true, "sStripEven": "odd", "bProcessing": true, "sPaginationType": "full_numbers", "aoColumns": [ { "sName": "ID", "bSearchable": false, "bSortable": false }, { "sName": "Service_ID" }, { "sName": "blank" }, { "sName": "Service_Shift_Item_ID" }, { "sName": "Shift_ID" }, { "sName": "Status" }, { "sName": "Notes" }, { "sName": "ImportProcessStatus" } ] }); });
Thanks

Replies

  • Posts: 22,406
    Can you link us to a page which shows the error please? Myself and others have all run DataTables successfully with jQuery 1.6 and 1.6.1.

    Allan
  • edited October 2011 Posts: 1
    Not sure if there was ever a resolution to this, but I'm getting a similar error due to this line of code:

    availableSessionGroupDetailsTable = $('#availableSessionGroupDetailsTable').dataTable({ //grid is the id of the table "bJQueryUI": true, "bLengthChange": false, "bFilter": true, "sPaginationType": "full_numbers", "bInfo": true, 'aaData': arrayData, 'bRetrieve': true, 'aoColumns': [ { "bSearchable": true, "sTitle": "Name" }, { "bSearchable": true, "sTitle": "Description" }, { "bSearchable": false, "bVisible" : false } ] });
    Would there be a specific reason this would happen in IE8?

    Thanks,
  • Posts: 22,406
    No - I can't think of why this would happen in IE8 only. The error means that either the DataTables plug-in hasn't been loaded, jQuery has been loaded again (thus overwriting the old one) or $ is not jQuery.

    Allan
  • Posts: 1
    You need to initialise all variables in IE8. It means that the first line must be

    var availableSessionGroupDetailsTable = $('#availableSessionGroupDetailsTable').dataTable({
  • Posts: 22,406
    Ah! Interesting - I didn't know that, but very useful knowledge. It should be that it means the variable is entered into the global scope, but apparently that doesn't always happen!

    Allan
This discussion has been closed.