title: How to get selected row index from jquery datatables without using TableTool
body: <p>I need to get the row id or index of user selected rows from jquery datatables without using the TableTool.  Once I get the indexes or the Ids, I will use them to select these rows after the user comes back to the same page.  How do I get the row Id or index of the select rows?  Many thanks !</p>
  
  <p>JSP code:  </p>
  
  <pre><code> // when a row is selected, I want to get the row id or index
   $('#userTable tbody tr').on('click', function() 
   {
         var oTable = $('#userTable').dataTable();
         var data = oTable.fnGetData(this);
         selectedRowId = data[4]; 
         alert(selectedRowId); // this printed "undefined"
  
         var rowIndex = oTable.row(this).index();
         alert(rowIndex);  // this alert didn't even get invoked.
    });
  </code></pre>