title: Datatables - filter data from AJAX source
body: <p>I have a datatable and am fetching the data from an api. Now i have the status like active,inactive if the flag is active then i need to show in the datatble else i should not show the expired one.Here is my <a href="https://jsfiddle.net/lakshmipriya001/qLpdems2/3/" rel="nofollow noreferrer">fiddle</a>. In this fiddle am showing the active and inactive both. but i want to show only the active status.</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;table id="example" class="display" cellspacing="0" width="100%"&gt;
       &lt;thead&gt;
           &lt;tr&gt;
             &lt;th&gt;Name&lt;/th&gt;
             &lt;th&gt;Email&lt;/th&gt;
             &lt;th&gt;Subject&lt;/th&gt;
             &lt;th&gt;Status&lt;/th&gt;
             &lt;th&gt;Message&lt;/th&gt;
             &lt;th&gt;Details&lt;/th&gt;
           &lt;/tr&gt;
          &lt;/thead&gt;
   &lt;/table&gt;
  </code></pre>
  
  <p>SCRIPT:</p>
  
  <pre><code>$(document).ready(function() {
      $('#example').DataTable({
          "processing" : true,
          "ajax" : {
              "url" : "https://api.myjson.com/bins/12uwp2",
              dataSrc : ''
          },
          "columns" : [ {
              "data" : "name"
          }, {
              "data" : "email"
          }, {
              "data" : "subject"
          }, {
              "data" : "status"
          },{
              "data" : "message"
          },
          {
                  "mData": "Details",
                  "mRender": function (data, type, row) {
                      return "&lt;a class='delete' data-id=" + row.id + " href='/Details/" + row.id + "'&gt;Delete&lt;/a&gt;";
                  }
          }]
      });
      $(document).on("click", ".delete", function(e) {
          e.preventDefault()
          alert("Delete button clicked for Row number " + $(this).data("id"))
      })
  });
  </code></pre>
  
  <p>How to do this. Can  anyone help me how to do.</p>