I need to hide a column in a table, but after that I cannot read the value of the hidden column of the selected row.
dtTable = $('#lookupTable').DataTable({
"columnDefs": [
{
"targets": [ 0 ],
"visible": false,
"searchable": false
}
],
aaData: data,
aoColumns: cols,
paging: false,
scrollCollapse: true,
destroy: true
});
as you see, the first column is now hidden. And I'm trying to read the column value using this code
selectedIndex = $(this).find('td:eq(0)').text();
If I remove <"visible": false> from the code, I can read the first value of the column, but if it is hidden, it gives me the second value of the column.
I am tired of changing the "witdh" property, but it did not work.
source
share