aoColumnDefs - Error: $.isArray is not a function

aoColumnDefs - Error: $.isArray is not a function

dshdsh Posts: 19Questions: 0Answers: 0
edited May 2011 in General
Hi,

I want to view only 3 columns from 12 columns and i am getting this error. Is there anything wrong I am doing ???

[code]
"aoColumnDefs": [{ "sName": "systemID", "bVisible": false },
{ "sName": "clientID", "bVisible": false },
{ "sName": "clientDesc", "bVisible": false },
{ "sName": "clientName" },
{ "sName": "intentID", "bVisible": false },
{ "sName": "vendorOutputLocationId", "bVisible": false },
{ "sName": "outputLocDesc" },
{ "sName": "vendorOutputLocationDir", "bVisible": false },
{ "sName": "systemName" },
{ "sName": "intentName", "bVisible": false },
{ "sName": "clientActive", "bVisible": false },
{ "sName": "intentActive", "bVisible": false }]
[/code]

and in the HTML i have only 3 rows defined.

Replies

  • allanallan Posts: 63,522Questions: 1Answers: 10,473 Site admin
    Objects in aoColumnDefs need an aTargets property. From your structure above you want 'aoColumns' rather than 'aoColumnDefs': http://datatables.net/usage/columns

    Allan
  • dshdsh Posts: 19Questions: 0Answers: 0
    Here is what i have now, but still get the same error:

    [code]
    HTML code:



    systemName
    clientName
    outputLocDesc
    systemID
    clientID
    clientDesc
    intentID
    vendorOutputLocationId
    vendorOutputLocationDir
    intentName
    clientActive
    intentActive






    JQuery code:

    "aoColumnDefs": [
    { "sTitle": "systemID", "bVisible": false, "aTargets":[3]},
    { "sTitle": "clientID", "bVisible": false , "aTargets":[4]},
    { "sTitle": "clientDesc", "bVisible": false, "aTargets":[5]},
    { "sTitle": "clientName" , "aTargets":[1]},
    { "sTitle": "intentID", "bVisible": false , "aTargets":[6]},
    { "sTitle": "vendorOutputLocationId", "bVisible": false , "aTargets":[7]},
    { "sTitle": "outputLocDesc" , "aTargets":[2]},
    { "sTitle": "vendorOutputLocationDir", "bVisible": false , "aTargets":[8]},
    { "sTitle": "systemName", "aTargets":[0]},
    { "sTitle": "intentName", "bVisible": false, "aTargets":[9]},
    { "sTitle": "clientActive", "bVisible": false, "aTargets":[10] },
    { "sTitle": "intentActive", "bVisible": false, "aTargets":[11] }],

    [/code]
  • dshdsh Posts: 19Questions: 0Answers: 0
    plzz anybody could guide me whats the process here, i tried all possible combinations, but nothing seems to work.
    I have included these 2 javascript files ??




    does it make any difference ?

    Thanks
  • allanallan Posts: 63,522Questions: 1Answers: 10,473 Site admin
    Ah - you are using jQuery 1.2.1, which doesn't provide an isArray function - that was added in 1.3: http://api.jquery.com/jQuery.isArray/ . DataTables is not supported on jQuery 1.2, so I'd suggest you upgrade jQuery and it should be fine.

    Allan
  • dshdsh Posts: 19Questions: 0Answers: 0
    Hmm..
    When i downloaded datatables i downloaded these 2 javascript files:




    Firefox worked fine but not IE. IE did not like "jquery.js" , so i included the " jquery-1.2.0.js" and IE was fine with it and i continued working on it.

    So now, everything works great in firefox for "jquery.js" or "jquery-1.6.0.js".
    But nothing works in IE if i include any other java sctript files other than "jquery-1.2.0.js"
  • allanallan Posts: 63,522Questions: 1Answers: 10,473 Site admin
    I don't know why that would be - are you getting any script errors in the IE developer tools? Can you give us a link?

    Allan
  • dshdsh Posts: 19Questions: 0Answers: 0
    Ok, here is the issue.
    when i add localhost to my url, IE accepts it but not firefox.
    Firefox accepts only ip address on itsurls.

    So this has nothing to do with jquery files.Once i change the urls respectively depending on the browser, everything works fine.


    I have still not found the solution for it yet. I know this is not a datatable issue, but if you have any idea about it, please let me know.


    Thanks.
This discussion has been closed.