Anyone know how to add a custom option select filter to a jQuery DataTable?
Basically, like this example page but instead of having min/max text fields... change them to select options.
Anyone know how to add a custom option select filter to a jQuery DataTable?
Basically, like this example page but instead of having min/max text fields... change them to select options.
Easier than I thought it would be:
Javascript
$(document).ready(function() {
/* Initialise datatables */
var oTable = $('#example').dataTable();
/* Add event listeners to the two range filtering inputs */
$('select#engines').change( function() { oTable.fnFilter( $(this).val() ); } );
} );
HTML
<select id="engines">
<option value="">- Select -</option>
<option value="1.8">1.8</option>
<option value="1.9">1.9</option>
</select>
But this does not solve the problem, it does not search a range. It just filters base on the exact value.