Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82801

How To Hide A Column, But Still Use It With Double Click Event

$
0
0
I have a table with an ajax source. The data rows are dynamically generated, so I can't add a class that I can just hide.
I can hide a column just fine with oTable.fnSetColumnVis( 0, false ) or "bVisible":false.

However the problem I have is that I have a double click event that reads from the first column of the row I click on, so if I hide that column, the event no longer works.

Here is the click event I'm using...
$('#example').on('dblclick', 'tr', function(event) {
     var td = $('td', this);
     var RecordID= $(td[0]).text();
});

So you can see it's accessing the index of 0 (the first td or column in that row.) Once I hide that column, another td becomes index of 0.
I still need that RecordID column to get information from the row, but I don't want to show it on screen. Any ideas?

Viewing all articles
Browse latest Browse all 82801

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>