title: tell datatable to use custom button for file export
body: <p>I have a working html/js datatable example jsfiddle that has two working buttons for exporting data; excel and csv. I declare my datatable like so:</p>
  
  <pre><code>$('#example').DataTable( {
      dom: 'Bfrtip',
      columns: [
          { data: 'name' },
          { data: 'surname' },
          { data: 'position' },
          { data: 'office' },
          { data: 'salary' }
      ],
      buttons: [
                    {
                        extend: 'excelHtml5',
                        text: 'excel',
                        exportOptions: {  modifier: {  page: 'current' }  }
                    },
                    {
                        extend: 'csvHtml5',
                        text: 'csv',
                        exportOptions: {  modifier: {  page: 'current' }  }
                    }
                ]
  } );
  </code></pre>
  
  <p>Which cases the two default buttons to appear. In my html I have two custom button elements I want to connect to my datatable:</p>
  
  <pre><code>&lt;button id='excelExport'&gt;click this to export excel&lt;/button&gt;&lt;button id='csvExport'&gt;click this to export csv&lt;/button&gt;
  </code></pre>
  
  <p></p>
  
  <p>So that when I click my 'excelExport' button, it triggers the datatable export excel. I'm trying to get both custom buttons working so I can place them in more specific places with different styling, instead of using the table's default export buttons.</p>
  
  <p>How can I extend my datatable export excel function to work with my custom button with id=excelExport ? 
  I've done something similar in the past with using a custom search bar for my table's search. To do so I had to extend the search function like so:</p>
  
  <pre><code> //set datatable to use custom search box
  $('#bottomTableSearch').on('keyup change', function () {
      myBrandGapsTable.search(this.value).draw();
  });  
  </code></pre>
  
  <p>Is there someway I can do the same for my id=excelExport button? Like:</p>
  
  <pre><code>//set datatable to use custom excel export button
  $('#excelExport ').on('click', function () {
      myBrandGapsTable.export(excel); //???? pseudocode, trying to get this concept working
  });  
  </code></pre>
  
  <p>Jsfiddle with my example is here:</p>
  
  <p><a href="https://jsfiddle.net/martinradio/c0wezht7/12/" rel="nofollow noreferrer">https://jsfiddle.net/martinradio/c0wezht7/12/</a></p>