DataTables logo DataTables

Cannot read property 'asSorting' of undefined in dataTables 1.9?
  • Hi, we upgraded our dataTables plugin from the 1.7 version to the 1.9 version, and are getting this error:

    Cannot read property 'asSorting' of undefined

    On tables that are not sortable. All tables that are sortable are fine. Has anyone else had this same problem or know how to fix it?
  • I'm seeing this issue as well, though I've upgraded only from 1.9.2 to 1.9.3. I don't remember seeing it before then.
  • Here's a quick fiddle which displays the behavior:

    The fiddle uses jQuery 1.7.2 and DataTables 1.9.3 from the MSFT CDN.
  • There is no THEAD element, which is a prerequisite of DataTables:

  • Thank you for the quick response!

    I have corrected the fiddle, but still the error remains. I have re-read the prerequisites but don't see that I'm missing anything else.

    I tried adding an empty tr to the thead as well, but to no effect. I also added a th inside of the tr in the thead, but also to no effect.

    Any more suggestions?
  • Sorry, the updated fiddle can be found at
  • The THEAD is used by DataTables to tell it how many columns there are. An empty THEAD isn't going to do that, and DataTables could easily have injected that itself :-).

    The other issue was:


    That creates a 'TABLE' element, rather than selecting the one from the document. Remove the angle brackets to select the table (which /7 does).

This discussion has been closed.
All Discussions

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Get useful and friendly help straight from the source.