Hide first column, but access the data
Hide first column, but access the data
tonelm2
Posts: 5Questions: 2Answers: 0
What Im looking at doing is hiding the first column of data from a table, which is easy by doing:-
[code]
var oTable = $('#example').dataTable();
oTable.fnSetColumnVis( 0, false );
[/code]
However I still want to be able to access the data in that column to load the row:-
[code]
$("#example tbody tr").click( function( e ) {
var a = $(this).closest('tr').find('td:first').text();
alert(a);
});
[/code]
Currently however my code just returns the first column data instead of the hidden column data. Does anyone have any idea of how to hide the data but have it still visable?
Thank you
[code]
var oTable = $('#example').dataTable();
oTable.fnSetColumnVis( 0, false );
[/code]
However I still want to be able to access the data in that column to load the row:-
[code]
$("#example tbody tr").click( function( e ) {
var a = $(this).closest('tr').find('td:first').text();
alert(a);
});
[/code]
Currently however my code just returns the first column data instead of the hidden column data. Does anyone have any idea of how to hide the data but have it still visable?
Thank you
This discussion has been closed.
Replies
Allan