Bappa
Bappa

Reputation: 799

filter the exact word in datatables

I am using datatables plugin in my php script. For searching, I have a drop down box having two values "Active" and "Inactive". When I am searching by "Active" word, then it is showing the records, containing "Active" as well as "Inactive". I know this is happening only for that particular word("Active").

Then how to stop this wild cards search for this drop down box.

My code is like:

    $("#example").dataTable().columnFilter(
     {  

      "aoColumns": [                                    
        null,null,null,null,
{
         type: "select",
         values: [ 'Active', 'Inactive' ]
        },
      null                                                   ]
     }); 

Upvotes: 0

Views: 401

Answers (1)

Arjun
Arjun

Reputation: 21

Datatables have default option of search being caseinsensitive, so try to put the following while initialising your datatable.

$("#example").dataTable(
 {  

  "bCaseInsensitive": false,
 });

Upvotes: 2

Related Questions