title: YADCF custom_func not calling custom function
body: <p>I have a database field that contains either integer 1 (representing the value 'document') or integer 2 (representing the value 'email') and I use datatables to format/display these integers as the words 'document' or 'email' within the table column. I would therefore like to use YADCF to be able to select 'document' or 'email' and have datatables filter the resultset accordingly. 
  <a href="https://i.stack.imgur.com/hZS1y.jpg" rel="nofollow noreferrer">Link to screen shot of table column.</a></p>
  
  <p>I have used the custom_func feature as follows (code stripped down for brevity), but regardless of all other aspects of the datatable looking and working correctly, with a filter selector looking as expected and holding the selected value, and no console errors, my custom function is not being called. I have tried manually calling the custom function immediately before initialising YADCF, to check the scope, and it is being called just fine. Can anyone see anything obviously wrong please?</p>
  
  <pre><code>$(document).ready(function() {
      function customFilterDocEmail(filterVal, columnVal) {
          alert('customFilterDocEmail called');
          var found;
          if (columnVal === '') {
              return true;
          }
          switch (filterVal) {
              case 'doc':
                  found = columnVal === '1';
                  break;
              case 'email':
                  found = columnVal === '2';
                  break;
              default:
                  found = 1;
                  break;
          }
          if (found !== -1) {
              return true;
          }
          return false;
      }
  })
  
  
  var table = $('#table').DataTable({
    serverSide: true,
    processing: true,
    ajax: {
      url: '/api/datatables/getJson/doctext/doctexts',
      type: 'POST', 
      data: function(d) {d.CSRFToken = '****';}
    },
    stateSave: true,
    responsive: true,
    pageLength: 25,
    order: [[0, 'asc']],
    columns: [ 
      { data: 'txt_type', width: '10%' },
      { data: 'txt_title' },
      { data: 'txt_name', width: '20%' },
      { data: 'link', orderable: false, width: '5%' },
    ],
    }
  });
  
  yadcf.init(table, [ 
    { column_number: 0, filter_type: 'custom_func', custom_func: customFilterDocEmail,
      data: [{ value: 'doc', label: 'Document' }, { value: 'email', label: 'Email' }] },
    { column_number: 1, column_data_type: 'text', filter_type: 'text', filter_delay: 500, filter_default_label: '', },
    { column_number: 2, column_data_type: 'text', filter_type: 'text', filter_delay: 500, filter_default_label: '', },
    ], 'footer');
  </code></pre>
  
  <ul>
  <li>YADCF Version: 0.9.3.beta.11</li>
  <li>DataTables Version: 1.10.16</li>
  </ul>
  
  <p><strong>UPDATE:</strong> I haven't a clue what I'm doing wrong above, but I have come up with a little hack that saves having to use 'custom_func' and a custom filter. I've used the standard 'select' filter type but intercepted the filter string within the filter() method of my DatatablesSSP script thus:</p>
  
  <pre><code>$str = $requestColumn['search']['value'];    
  // returned search values for doctext 'txt_type' are Document/Email, so we need to map these to 1/2.
  if ($column['db'] == 'txt_type') {
      if ($str == 'Document') { $str = '1'; }
      if ($str == 'Email') { $str = '2'; }
  }
  </code></pre>
  
  <p>This works a treat :)</p>