title: DataTables, select rows and pass back ID for delete
body: <p>first time posting here but i really need help. Been working on this little project for a while and am finding Datatables to be next to useless but im being told i must use it....anyway Ive got it displaying our table from an ajax call to our SQL server. It needs to let the user select a few rows and click a delete button. It then SHOULD get the ID from each selected row and pass it back via an ajax call to our server which will then delete the value. </p>
  
  <p>Ive tried about 5 diff row select methods, more delete attempts then i can count, and NOTHING is working. Ive asked for help on their support site several times over the past couple weeks and havent gotten a single reply so hoping the people here may be able to help more :) </p>
  
  <p>Anyway heres my code: <a href="http://jsfiddle.net/dSLnT/3/#toggle-sidebar" rel="nofollow">JSFIDDLE</a>  <em>UPDATED TO CURRENT</em></p>
  
  <pre><code>$(document).ready(function(){
  var oTable = $('#dataTable').dataTable({
      //"bServerSide": true,
      "bProcessing": true,
      "bJQueryUI": true,
      "bPaginate": true,
      "sPaginationType": "full_numbers",
  
      "iDisplayLength": 10,
      "aLengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]],
      "sDom": 'pT&lt;&gt;&lt;f&gt;rt&lt;il&gt;',
      "sAjaxSource": 'dataTable/getCmsGroupData',
  
      "aoColumns": [
                      { "mData": "id", "sTitle": "ID", 
                          "fnRender": function (oObj) {
                              return '&lt;a href="cmsgroup_update?id='+ oObj.aData["id"] + '"&gt;' + oObj.aData["id"] + '&lt;/a&gt;';
                            }},
                      { "mData": "version", "sTitle":"Version" },
                      { "mData": "name", "sTitle": "Name" },
                      { "mData": "description", "sTitle": "Description"},
                      { "mData": "notes", "sTitle": "Notes"},
                   ],
      "oTableTools": {
          "aButtons": [
                      "select_all",
                      "select_none", 
                      {
                          "sExtends": "text",
                          "sButtonText": "Create New Entry",
                          "fnClick": function ( nButton, oConfig, oFlash ) {
                              window.location = "cmsgroup_add";
                         }
                      }]
                  }               
              });
  
  
  
  $("#dataTable tbody").click(function(event) {
      $(oTable.fnSettings().aoData).each(function (){
          $(this.nTr).removeClass('row_selected');
      });
      $(event.target.parentNode).addClass('row_selected');
  });
  
  
  
  function fnGetSelected( oTableLocal )
  {
      var aReturn = new Array();
      var aTrs = oTableLocal.fnGetNodes();
      for ( var i=0 ; i&lt;aTrs.length ; i++ )
      {
  
          if ( $(aTrs[i]).hasClass('row_selected') ) 
          {
              aReturn.push( aTrs[i] );
          }
      }
      return aReturn;
  }
  
  $("#delete").click(function(){
  
      selected = fnGetSelected(oTable);
      oTable.fnDeleteRow( selected[0]);
      $.ajax({
          type: "POST",
          url: "dataTable/delete/cmsGroup",  
          data:   'tableData='+ $(selected).text(),  
          success: function(result) {  
              alert("worked!");
          }  
      });
  });
  } );
  </code></pre>
  
  <p>Any help would be great!!!</p>