Table Initialization error - oColumn is undefined

Table Initialization error - oColumn is undefined

donzdonz Posts: 6Questions: 0Answers: 0
edited March 2011 in General
I'm attempting to intialize a datatable with:

oTable = jQuery('#schedule').dataTable();

but I get an error: oColumn is undefined

which happens around here in jquery.datatables.js:

/* If aaSorting is not defined, then we use the first indicator in asSorting */
6790 if ( typeof oInit.aaSorting == "undefined" &&
6791 typeof oSettings.saved_aaSorting == "undefined" )
6792 {
6793 oSettings.aaSorting[i][1] = oColumn.asSorting[0];
6794 }

I have already had a look at this discussion: http://datatables.net/forums/comments.php?DiscussionID=1363 but it is not the same root cause...i.e. I do not have multiple datatables on the same page.

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Are you using DataTables 1.7.6? Also what is the HTML you are using? Better yet, can you give us a link so I can see it in action?

    Allan
  • donzdonz Posts: 6Questions: 0Answers: 0
    Yes, DataTables 1.7.6.

    Here's the table:











    Last NameFirst Name
    Start DateEnd Date% Time
    Delete?




    Smith

    John
    2011-03-15

    2011-03-15
    100
  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Ah - try using TH elements for the cells in the header rather than TD. DataTables expects a TH cell for each column.

    Allan
  • donzdonz Posts: 6Questions: 0Answers: 0
    That worked, thanks.
  • prkarthikprkarthik Posts: 13Questions: 0Answers: 0
    hi allan,

    i tried using th tag..but still i have the problem ..ie oColumn is undefined..
This discussion has been closed.