title: Uncaught TypeError: table.search(...).draw is not a function
body: <p>Added filtering to a jQuery DataTables plugin, and it is not working very well. </p>
  
  <p>I want to have two links that will search for records on specific search words. To figure out how to do that I first tried to use <a href="https://datatables.net/reference/api/draw()#Examples" rel="noreferrer">this example</a>. It uses an input field to search for values in the table. It generates this error: </p>
  
  <blockquote>
    <p>Uncaught TypeError: table.search(...).draw is not a function</p>
  </blockquote>
  
  <p>My code:</p>
  
  <pre><code>$(document).ready(function() {
      $('#store-list').dataTable({
          "sPaginationType": "full_numbers"
      });
  
      var table = $('#store-list').DataTable();   
  
      $('#myFilter').on( 'keyup', function () {
      table
          .search( this.value )
          .draw();
      } );
  });
  </code></pre>
  
  <p>I have tried different things to make this work:</p>
  
  <ul>
  <li><p>Swapped <code>.DataTable()</code> with <code>.dataTable().api()</code> and <code>.dataTable()</code></p></li>
  <li><p>Tried <code>( this.val() )</code> and <code>( $('#myFilter').val() )</code> (<a href="https://stackoverflow.com/questions/27067590/datatables-typeerror-draw-is-not-a-function">link</a>)</p></li>
  <li><p>Tried <code>table.search( this.value ).draw;</code> (without <code>()</code> )</p></li>
  <li><p>In desperation I tried without <code>search</code> and then without <code>draw</code></p></li>
  </ul>
  
  <p>Can someone please help me find the error?</p>