title: How To Hide A Table Column, But Still Use It With A Click Event? (JQuery Datatables)
body: <p>I'm getting a RecordID and a Title from my datasource.  I only want to display the Title column on screen, but I need the RecordID from the row to be used in a click event.  So I'm pulling them both into my table and I'm looking to hide the RecordID.  </p>
  
  <p>I have a table that is populated with an ajax source so the <code>&lt;tr&gt;</code> and <code>&lt;td&gt;</code> tags for my data are dynamically created.  They aren't part of the code, so I can't simply add a class that I can hide with CSS.</p>
  
  <pre><code>&lt;table id="example"&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;RecordID&lt;/th&gt;
              &lt;th&gt;TITLE&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;!---Data and tags are dynamically generated---&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>The DataTables documentation lists a couple options of adding the function <code>oTable.fnSetColumnVis( 0, false )</code> or the <code>"bVisible":false</code> attribute.  Both of these work fine to hide my column, but then the click event I had based on that column will no longer work.</p>
  
  <p>Here's the click event I'm using.</p>
  
  <pre><code>$('#example').on('dblclick', 'tr', function(event) {
   var td = $('td', this);
   var RecordID= $(td[0]).text();
  });
  </code></pre>
  
  <p>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?</p>