DataTables logo DataTables

[Need help] Uncaught TypeError: Cannot call method 'fnSetData' of undefined
  • Hello,

    I really like the examples from these datatables, however I can't get it to work.
    I've tried 3 different versions;
    1. The minified v1.8.2;
    2. The full v1.8.2;
    3. The minified v1.9 beta;

    In all 3 versions I get this error:
    Uncaught TypeError: Cannot call method 'fnSetData' of undefined
    _fnSetCellDatajquery.dataTables.js:6711
    _fnGatherDatajquery.dataTables.js:2849
    $.fn.dataTablejquery.dataTables.js:7422
    e.extend.eachjquery-1.7.1.min.js:2
    e.fn.e.eachjquery-1.7.1.min.js:2
    $.fn.dataTablejquery.dataTables.js:6923
    (anonymous function)Global13.js:21
    f.Callbacks.njquery-1.7.1.min.js:2
    f.Callbacks.o.fireWithjquery-1.7.1.min.js:2
    e.extend.readyjquery-1.7.1.min.js:2
    c.addEventListener.B

    Does anyone know what the problem is and how I can fix this?
  • You are going to need to give us a lot more information than that - ideally a link to your test page :-).

    Are you using mDataProp in your initialisation? My guess is that one of those is a little off from what the data model is.

    Allan
  • Thankyou for your reply.

    I do the default initialisation:
    if ($("#tbl_TransactionItems").length) {
    $("#tbl_TransactionItems").dataTable();
    }

    Here is my table (I deleted the rows, because that's not really what you need to know):
    <table id="tbl_TransactionItems">

    </table>

    I load the jQuery Libraries first, datatables next.. And in Global I've the initialisation.
    <script type="text/javascript" language="javascript" src="http://localhost.mws.nl:9000/Includes/Javascript/jquery-1.7.1.min.js"></script>;
    <script type="text/javascript" language="javascript" src="http://localhost.mws.nl:9000/Includes/Javascript/jquery.dataTables.js"></script>;
    <script type="text/javascript" language="javascript" src="http://localhost.mws.nl:9000/Includes/Javascript/Global13.js"></script>;

    I don't have a testpage which I can show right now, the page I've got is confidential. If this is still not enough information, then I guess I have to setup a testpage somewhere.
  • Okay in that guess I'm changing my guess to a missing cell in the table, or a rowspan / colspan in the tbody :-).

    But not, I'm afraid still not enough information to say exactly what is causing it. I'd need to see the table actually running I think.

    Allan
  • Thankyou very much, this has helped me. I was missing two <th>, since those columns didn't have a header name, so now I added 2 empty <th> and it works.

    Thankyou again.
This discussion has been closed.
All Discussions