Object doesn't support property or method 'dataTable'

Object doesn't support property or method 'dataTable'

venumvenum Posts: 1Questions: 0Answers: 0
edited May 2011 in Bug reports
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:
[code]
$("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" } ]
});
});
[/code]

Thanks

Replies

  • allanallan Posts: 63,383Questions: 1Answers: 10,449 Site admin
    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
  • barnesanovabarnesanova Posts: 1Questions: 0Answers: 0
    edited October 2011
    Not sure if there was ever a resolution to this, but I'm getting a similar error due to this line of code:

    [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 }
    ]
    });
    [/code]

    Would there be a specific reason this would happen in IE8?

    Thanks,
  • allanallan Posts: 63,383Questions: 1Answers: 10,449 Site admin
    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
  • bukkabukka Posts: 1Questions: 0Answers: 0
    You need to initialise all variables in IE8. It means that the first line must be

    [code]var availableSessionGroupDetailsTable = $('#availableSessionGroupDetailsTable').dataTable({ [/code]
  • allanallan Posts: 63,383Questions: 1Answers: 10,449 Site admin
    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.