Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Rajib Palit
Added: Jan 23, 2018 8:06 AM
Modified: Jan 23, 2018 8:06 AM
Views: 7
Tags: no tags
Search individual row
  1. var table = $(\'#datatable\').DataTable();
  2. $(\'.dataTables_filter input\').unbind().on(\'keyup\', function() {
  3. var searchTerm = this.value.toLowerCase();
  4. $.fn.dataTable.ext.search.push(function(settings, data, dataIndex) {
  5. if (~data[0].toLowerCase().indexOf(searchTerm)) return true;
  6. if (~data[1].toLowerCase().indexOf(searchTerm)) return true;
  7. return false;
  8. })
  9. table.draw();
  10. $.fn.dataTable.ext.search.pop();
  11. });