Filter doubts

Filter doubts

matheusrocha89matheusrocha89 Posts: 2Questions: 0Answers: 0
edited February 2014 in DataTables 1.9
I created a table with some sample datas that I created and initialize the dataTable...amazing, everything works GREAT! But I have a doubt, imagine that in one column I have 3 kind of data: VIP, Regular and Trial...Is there some way in the search input I write something like this: "VIP Regular" and the dataTable filter rows of both values? I tried but didn't work cause the dataTable tried to find the column that have both values together.

Replies

  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin
    You would need to use fnFilter with smart filtering disabled if you want to do a simple string match.

    Allan
  • matheusrocha89matheusrocha89 Posts: 2Questions: 0Answers: 0
    I saw in documentation that fnFilter is a function, so i can't initialize the dataTable with the smart filtering disabled and the search input works without the smart filtering? I need to pick the string and call the fnFilter? The parameters are passed one by one, or it's a JSON like the initialize options?
  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin
    Sure you can - use oSearch if you want to modify the search defaults: http://datatables.net/ref#oSearch .

    This is the dev documentation for the search configuration object: http://datatables.net/docs/DataTables/1.9.4/DataTable.models.oSearch.html . You can modify it to alter the default as well as another option..

    Allan
This discussion has been closed.