Impossible to hide a column ?

Impossible to hide a column ?

jlfjlf Posts: 6Questions: 0Answers: 0
edited March 2010 in General
I want to display a table with two hidden columns
"aoColumns": [
{ "sWidth": "400px","sType": "string", "fnRender": function ( oObj ) {
return oObj.aData[5] + oObj.aData[0];
}
},
{ "sWidth": "30px" ,"sType": "string"},
{"sWidth": "30px" , "sType": "string"},
{ "sWidth": "90px" , "sType": curFormat, "fnRender": function ( oObj ) {
if (lang='en') {return $.format.date(oObj.aData[3],"MM/dd/yyyy hh:mm");} else {return $.format.date(oObj.aData[3], "dd/MM/yyyy hh:mm");}}},
{ "sWidth": "90px" , "sType": curFormat, "fnRender": function ( oObj ) {
if (lang='en') {return $.format.date(oObj.aData[4], "MM/dd/yyyy hh:mm");} else {return $.format.date(oObj.aData[4], "dd/MM/yyyy hh:mm");}}},
{ "bVisible": false },
{ "bVisible": false }
],

The 6th one is merged with the first one and the last one contains an id that will be attached to the row using

"fnRowCallback": function( nRow, aData, iDisplayIndex ) {
$(nRow).attr("id",'tr-'+aData[6]);
return nRow;
}


When I do so, I get this error
TypeError: Result of expression 'nTh.parentNode' [null] is not an object.

But if I change the attributes of the last column to make it visible, it works fine.

{ "bVisible": false },
{ "bVisible": true }

What am I doing wrong?

Thanks

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Do you have 7 TH elements in your THEAD?

    Allan
  • jlfjlf Posts: 6Questions: 0Answers: 0
    No, that was it.
    Thanks
This discussion has been closed.