title: DataTables and columnDefs Rendering Data
body: <p>I am using datatables 1.10.19 and I would like to filter data based on the contents of a table cell.</p>
  
  <p>I am using the <a href="https://datatables.net/reference/option/columnDefs" rel="nofollow noreferrer">columnDefs</a> option to alter the contents of the returned data.</p>
  
  <p>I am using <a href="https://github.com/DataTables/DataTablesSrc/blob/master/examples/server_side/scripts/server_processing.php" rel="nofollow noreferrer">this php script</a> to retrieve data.</p>
  
  <p>My code is;</p>
  
  <pre><code>$('#example').DataTable({
  processing : true,
  serverSide : true,
  ajax: url": '/server_processing.php',
  columnDefs: [{
      targets: 5, // row 6 in the html table
      "render": function(data, type, row) {
          if (row[5] == 0) {
              data = 'rejected';
          }
          return data;
      },
  }]
  });
  </code></pre>
  
  <p>This successfully displays a table, and <code>rejected</code> in column 6 when <code>0</code> is returned from the database. However datatables won't allows me to filter on the <strong>word</strong> <code>rejected</code>. I get <code>No matching records found</code>, however I can filter on the integer <code>0</code>. </p>
  
  <p>I thought datatables was supposed to filter what was displayed in the table?</p>
  
  <p>Any advice is appreciated.</p>