title: Get Multiple Selected Row html data out of Datatables
body: <p>I am using Datatables (datatables.net) successfully to display all the data I need. But I am having difficulty understanding how to pull out selected column data from a json object. I have failed to JSON.stringify the object, as well as attempt to access the properties of the object directly.</p>
  
  <p>The use of the datatables allows the user to select multiple rows and a built in button will perform a submit action to my rails server. I currently cannot access the object to parse the data. I may need a loop and thats fine, but again, I am having difficulty understanding the library on multiple select. </p>
  
  <p>I have successfully console.log the object and verified the data I want is present. I currently want the 1 index of Array[12] for n selected rows. I have figured out how to provide a count of the selected rows, so I can parse the object using the count as a loop limiter. But again my attempts have failed.</p>
  
  <p>Console.log object:</p>
  
  <pre><code>    [Array[12], Array[12], Array[12], context: Array[1], selector: Object, ajax: Object, colReorder: Object, keys: Object]
      0:Array[12]0:""1:"36"2:
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>    $(document).ready(function() {
  $('.stay').DataTable( {
    dom: "&lt;'row'&lt;'col-sm-8'B&gt;&lt;'col-sm-4'f&gt;&gt;"+ 'rt' + "&lt;'row'&lt;'col-sm-6'i&gt;&lt;'col-sm-6'p&gt;&gt;",
    buttons: [
      'selectNone',
      'selectAll',
      {
          extend: 'selected',
          text: 'Assign Rooms',
          action: function ( e, dt, node, config ) {
              var rows = dt.rows( { selected: true } ).count();
              var selected_rows = dt.rows( {selected: true} ).data(0);
              console.log(selected_rows);
  
              url = window.location;
              // index = url.indexOf("housekeeper")
              // alert(index);
              alert( 'There are '+rows+'(s) selected in the table' );
              alert(selected_rows[0])
                  // $.ajax({
                  //   url: "/BookCreate/?mdate="+mdate+"&amp;phone="+phone,
                  //   type: "post",
                  //   data: values,
                  //   success: function(){
                  //     alert('Saved Successfully');
                  //   },
                  //   error:function(){
                  //    alert('Error');
                  //   }
                  // });
          }
      },
      {
        extend: 'colvis',
        text: 'Columns',
        autoClose: true,
      },
        {
            extend: 'copy',
            text:      '&lt;i class="fa fa-files-o"&gt;&lt;/i&gt;',
            exportOptions: {
                columns: ':visible'
            }
        },
        {
            extend: 'excel',
            text:      '&lt;i class="fa fa-file-excel-o"&gt;&lt;/i&gt;',
            exportOptions: {
                columns: ':visible'
            }
        },
        {
            extend: 'csv',
            text:      '&lt;i class="fa fa-file-code-o"&gt;&lt;/i&gt;',
            exportOptions: {
                columns: ':visible'
            }
        },
        {
            extend: 'pdf',
            text:      '&lt;i class="fa fa-file-pdf-o"&gt;&lt;/i&gt;',
            exportOptions: {
                columns: ':visible'
            }
        },
        {
            extend: 'print',
            text:      '&lt;i class="fa fa-print"&gt;&lt;/i&gt;',
            exportOptions: {
                columns: ':visible'
            }
        },
    ],
    columnDefs: [ {
        visible: false
    } ],
      columnDefs: [ {
          orderable: false,
          className: 'select-checkbox',
          targets:   0
      } ],
  
      select: {
          style:    'os',
          selector: 'td:first-child',
          style: 'multi'
      },
      order: [[ 2, 'asc' ]]
  } ).on( 'buttons-action', function ( e, buttonApi, dataTable, node, config ) {
      // action put here
      console.log( 'Button '+buttonApi.text()+' was activated' );
  } );;
  </code></pre>
  
  <p>} );</p>