Impossible to hide a column ?
Impossible to hide a column ?
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
"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
This discussion has been closed.
Replies
Allan
Thanks