title: DataTables: Reset table data
body: <p>Have some data, whick comes from AJAX and is rendered in table. Also have toggle button, its phases are 'Show duplicates' and 'Show all'. When come to page first time, all data is rendered, button phase is 'Show duplicates'. If press 'Show duplicates', special ajax request goes to server, and response is processsing in JS:</p>
  
  <pre><code>if (res[0] == '200' || res[0] == '404') {
      if (!is_duplicates_showed) { //if pressed 'Show duplicates'
  
         $.fn.dataTable.ext.search.push(
             function(settings, data, dataIndex) {
                 return $.inArray($(table.row(dataIndex).node()).find('td:first').find('form').find('input[name="registration_id"]').val(), res[1]) &gt; -1;
             }
         ); 
  
         table.draw();
     } else { //if pressed 'Show all'
  </code></pre>
  
  <p>Result: only those rows are visible, which <code>registration id</code> appropriates to such ids from ajax. Button phase changes to 'Show all'.</p>
  
  <p><strong>Question</strong>: how to reset data (show all data again), when press 'Show all'?</p>
  
  <p>What I tried (in <code>else</code> section):</p>
  
  <p>1.</p>
  
  <pre><code>var table = $('#participants').DataTable();
  table 
       .search( '' )
       .columns().search( '' )
       .draw();
  </code></pre>
  
  <p>2.</p>
  
  <pre><code>$.fn.dataTable.ext.search.pop();
  </code></pre>
  
  <p>3.</p>
  
  <pre><code>table.destroy();
  var newTable = $('#participants').DataTable();
  newTable.draw();
  </code></pre>
  
  <p>No success. After these operations I still see "filtered" rows, which were given by <code>push()</code> result.</p>