0

I use Datatables to build up a table and to make it searchable.

$('#table').DataTable({
    "paging" :      true,
    "info" :        true,
    "bFilter" :      true,
});

I have a column, which contains the values "security" and "non-security". If I search for "security"... it matches of cause to both.

My Question is: How to use or how to configure datatables, that the search will filter out "non-security" items when searching for "security"?

Rooterle
  • 373
  • 1
  • 4
  • 12

1 Answers1

0

The DataTable plugin, by default sets the "smart" option to true. Set it to false.

    $('#table').DataTable({
        "paging" : true,
        "info"   : true,
        "search": {
            "smart": false
        }
    });

Update:

I think it's already answered here. How to get exact match using fnFilter?

Community
  • 1
  • 1
dr_dev
  • 492
  • 3
  • 17