title: datatable custom dropdown for sort
body: <p>I have below dropdown.</p>
  
  <pre><code>&lt;select name="sortBy" id="sortBy"&gt;
      &lt;option value="0_asc" selected="selected"&gt;Reference #&lt;/option&gt;
      &lt;option value="0_desc"&gt;Reference # (desc)&lt;/option&gt;
      &lt;option value="pe-sku-column_asc"&gt;Part # (asc)&lt;/option&gt;
      &lt;option value="pe-sku-column_desc"&gt;Part # (desc)&lt;/option&gt;
      &lt;option value="pe-title-column_asc"&gt;Description (asc)&lt;/option&gt;
      &lt;option value="pe-title-column_desc"&gt;Description (desc)&lt;/option&gt;
      &lt;option value="pe-price-column_asc"&gt;Price (asc)&lt;/option&gt;
      &lt;option value="pe-price-column_desc"&gt;Price (desc)&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>Now I want to sort my <code>datatable</code> according to the dropdown selection</p>
  
  <p>I tried this</p>
  
  <pre><code>jQuery(document).ready(function ($) {
      var oTable = $('#super-product-table').DataTable({
          dom: 't'
      });
  
      $('#myInputTextField').keyup(function () {
          oTable.search($(this).val()).draw();
      })
  
      $("#sortBy").change(function () {
  
          oTable.fnSort([[1, 'asc']]);
      })
  });
  </code></pre>
  
  <p>But it gives me </p>
  
  <blockquote>
    <p>TypeError: oTable.fnSort is not a function</p>
  </blockquote>
  
  <p>I have search for <a href="https://datatables.net/forums/discussion/4528/fnsort-osettings-aocolumns-icolumn-is-undefined" rel="nofollow noreferrer">fnsort</a> in <code>datatable.js</code> and found it.</p>
  
  <p>One more thing, when I change <code>DataTable</code> to <code>dataTable</code> sorting started working and custom search stop.</p>