oColumn is undefined

oColumn is undefined

F2000F2000 Posts: 6Questions: 0Answers: 0
edited November 2011 in Bug reports
Hi,

I just downloaded the version 1.8.2 and when I use the "simple" table as
[code]


$('#devis_table').dataTable();

[/code]


I get the error oColumn is undefined (file: jquery.dataTables.js, line 7365).

[code]
/*
* Sorting
* Check the aaSorting array
*/
for ( i=0, iLen=oSettings.aaSorting.length ; i= oSettings.aoColumns.length )
{
oSettings.aaSorting[i][0] = 0;
}
var oColumn = oSettings.aoColumns[ oSettings.aaSorting[i][0] ];

/* Add a default sorting index */
if ( typeof oSettings.aaSorting[i][2] == 'undefined' )
{
oSettings.aaSorting[i][2] = 0;
}

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

/* Set the current sorting index based on aoColumns.asSorting */
for ( j=0, jLen=oColumn.asSorting.length ; j

Replies

  • F2000F2000 Posts: 6Questions: 0Answers: 0
    This is fixed. But I don't remember how I fixed it... Just that that was really dumb ! :p
  • F2000F2000 Posts: 6Questions: 0Answers: 0
    edited February 2012
    Oh yeah I remember !
    I don't put a [head] in my datatable... Don't know if it's specified in the documentation..
  • medhimedhi Posts: 1Questions: 0Answers: 0
    edited May 2012
    If you have th elements in your table you have to put them inside thead. This is how I got it right:
    [code]



    Column 1
    Column 2




    Data 1
    Data 2



    [/code]
  • allanallan Posts: 63,382Questions: 1Answers: 10,449 Site admin
    DataTables also copes with TH elements in the TBODY :-)

    Allan
This discussion has been closed.