title: datatables buttons enable/disable example not working
body: <p>I'm using datatables with custom buttons. I'm looking in the <a href="https://datatables.net/extensions/buttons/examples/api/enable.html" rel="nofollow">examples</a>, also googled a bit but I didn't find a working solution.</p>
  
  <p>The problem is that, when I deselect the row the button is still enabled. What is the proper way to enable/disable the buttons when a row is selected/deselected?</p>
  
  <pre><code>var table = $('#example').DataTable( {
      serverSide: true,
      dom: 'Bfrtip',
      ajax: '/get?op=2',
      columns: [
          { data: 'id' },
          // more columns
      ],
      buttons: [
          {
              text: 'New',
              action: function ( e, dt, node, config ) {
                  window.location.href = '/property?option=new'
              }
          },
          {
              text: 'Modify',
              action: function ( e, dt, node, config ) {
                  window.location.href = '/property?option=modify&amp;id=' + data.id
              },
              enabled: false
          },
          {
              text: 'Delete',
              action: function ( e, dt, node, config ) {
              },
              enabled: false
          }
      ],
      select: true
  } );
  
  table.on( 'select', function () {
      var selectedRows = table.rows( { selected: true } ).count();
  
      table.button( 1 ).enable( selectedRows === 1 );
      table.button( 2 ).enable( selectedRows === 1 );
      table.button( 3 ).enable( selectedRows === 1 );
      //table.button( 1 ).enable( selectedRows &gt; 0 );
  } );
  </code></pre>
  
  <p>Also how can I get the id value for the selected row?</p>
  
  <pre><code>action: function ( e, dt, node, config ) {
      window.location.href = '/property?option=modify&amp;id=' + data.id
  },
  </code></pre>