Cannot call method fnSetData to undefined

Cannot call method fnSetData to undefined

archer42archer42 Posts: 2Questions: 0Answers: 0
edited February 2012 in General
Hi,
because I wanted to keep my php-web-app clean I decided to use a jquery-plugin to sort and paginate the tables.

I am using Symfony2 and added following code:
[code]



$(document).ready(function() {
$('#datatable').dataTable();
} );

[/code]

When I now load the page there isn't anything changed... Chrome outputs following error:
[quote]Uncaught TypeError: Cannot call method 'fnSetData' of undefined[/quote]

What am I doing wrong?

Replies

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    No idea - it looks okay from what you've got above! What does your HTML table look like?

    Allan
  • archer42archer42 Posts: 2Questions: 0Answers: 0
    Hi,

    [code]{% block article %}




    UID
    Firstame
    Lastname
    Username
    Status



    {% for user in users %}

    {{ user.userId }}
    s{{ user.firstName }}
    s{{ user.lastName }}
    {{ user.username }}
    {{ user.email }}
    s{{ user.isActive }}

    {% endfor %}



    {% endblock %}[/code]

    If you wunder why I put "s" into the fields:
    Not all fields of a table are filled so I put in the "s" to check that this isn't a problem.
  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    You've got 5 columns in the header and 6 columns in the body. DataTables is objecting to that mismatch.

    Allan
  • tyfytyfy Posts: 2Questions: 0Answers: 0
    Hi ,

    I get the same error, but my gridview have no span column the header count and body are the same. Any idea what will caused this other than the column matching?? FYI , my data are bind in a gridview.
This discussion has been closed.