Datatables exact word search

前端 未结 3 1947
天命终不由人
天命终不由人 2020-12-11 23:32

Hi I\'m using datatables and I would like to filter my data by an exact word.

My table data looks like below;

+-----+----------+
| num | status   |
+         


        
3条回答
  •  再見小時候
    2020-12-11 23:56

    To filter search result with an exact match could be done this way -

    table.column(index).search("^" + searchText + "$", true, false).draw();
    

    More info - https://stackoverflow.com/a/19114759/698127

提交回复
热议问题