title: Ajax searching in Datatables
body: <p>What I'm trying to do is to do an ajax search to a datatable.
  I'm not considering the default search functionality provided by datatables for some reasons, so I created a textbox with a button for it.</p>
  
  <p>On my Api, I'm sending back a Json for the javascript function</p>
  
  <pre><code>$("#buttonSearchDevice").on('click', function () {
  
      var searchString = $("#searchString").val();
  
      $.ajax({
          url: "/Devices/LoadDevices",
          type: "GET",
          contentType: "application/json; charset=utf-8",
          dataType: "json",
          data:
              {
                  searchString: searchString
              },
          success: function (data) {
  
              //if (data.length == 0)
              //    $('#devicesList').dataTable().fnClearTable();
              //else {
              //    $('#devicesList').dataTable().fnClearTable();
              //    $('#devicesList').dataTable().fnAddData(data);
              //}
          }
      });
  });
  </code></pre>
  
  <p>I tried the commented code to "refresh" my datatables, but no success, I'm getting the following error:</p>
  
  <blockquote>
    <p>DataTables warning: table id=devicesList - Requested unknown parameter
    'model' for row 0, column 1. For more information about this error,
    please see <a href="http://datatables.net/tn/4" rel="nofollow noreferrer">http://datatables.net/tn/4</a></p>
  </blockquote>
  
  <p>Do I need to recreate the entire datatable (destroy and create) or is possible to just refresh it with the new comming data?</p>