jQuery DataTables - Filter column by exact match

前端 未结 9 2485
感动是毒
感动是毒 2020-11-27 18:06

Trying to only display exact matches to the search term entered in the search bar.

For instance, I have a search bar that filters by ID#. I want only records that m

9条回答
  •  -上瘾入骨i
    2020-11-27 18:44

    $(document).ready(function() {
        tbl = $('#example').dataTable();
        tbl.fnFilter("^" + filter_value + "$");
    });
    

    Where filter_value is the string entered in the filter field.

提交回复
热议问题