Hidden columns missing from DOM

Hidden columns missing from DOM

mfaughnmfaughn Posts: 2Questions: 0Answers: 0
edited September 2013 in General
I am starting up a dataTable with these options:
[code]
{
"oLanguage": {
"sEmptyTable": "Search Results"
},
"aoColumns": [
{ "mData": "pub_num" },
{ "mData": "vol" },
{ "mData": "chem_sys" },
{ "mData": "authors" },
{ "mData": "years" },
{ "mData": "id", "bVisible": false }
],
"aoColumnDefs": [
{ "sWidth": "55px", "aTargets": [ 0 ] }
// { "sWidth": "50px", "aTargets": [ 1 ] },
// { "sWidth": "30px", "aTargets": [ 4 ] }
],
"bPaginate": false,
"bLengthChange": false,
"bFilter": false,
"bSort": false,
"bInfo": false,
"bAutoWidth": false,
"sScrollY": "300px"
}
[/code]

I later populate the table with fnAddData(), passing it an array of json objects. My 6th column is totally missing from the DOM. This also seems to be the case in the 'Hidden Columns' example as well.

Any ideas?

Replies

  • mfaughnmfaughn Posts: 2Questions: 0Answers: 0
    ...meanwhile, every time I add to the table I'm iterating back over it adding what I need to the tr. Would save time and trouble if it would just go into a column.

    Either the behavior I'm expecting to see is not what is intended by bVisible or something is broken.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    This is intentional - it is ,issing from the DOM because its hidden. DataTables doesn't leave the hidden columns or rows in the document since that causes performance and cross browser issues.

    If you want the data from that column, you can use the fnGetData method.

    Allan
This discussion has been closed.