How to do caseinsensitive in dataTable() using fnFilter() in jquery? -
trying search table irrespective of case using fnfilter
datatable()
$('#search-users').on('keyup',function(){ if(tblactive){ tableactive._fnfilter($(this).val()); tableactive._fndraw(); } });
unable caseinsensitive data filter. want table search values irrespective of case. tried giving
tableactive._fnfilter($(this).val(),true);
but unable search caseinsensitive data.
1.10.4 jquery.datatables.js
then use api! datatables filtering is case insensitive default. either :
var tableactive = $(<selector>).datatable({ .. }); $('#search-users').on('keyup', function() { tableactive.search( this.value ).draw(); })
or id use oldschool datatable()
initialisation bacause need jquery instance :
var tableactive = $(<selector>).datatable({ .. }); $('#search-users').on('keyup',function() { tableactive.api().search( this.value ).draw(); })
only if want case sensitive filtering you'll need :
var tableactive = $(<selector>).datatable({ caseinsensitive: false });
Comments
Post a Comment