search highlighting using mark.js

search highlighting using mark.js

ltdetaltdeta Posts: 31Questions: 11Answers: 0

I would like to implement search highlighting using mark.js with DataTables 2
https://datatables.net/blog/2017/search-highlighting-with-markjs#Adding-custom-mark.js-options

JS Bin test case
https://live.datatables.net/teripiyu/1/edit

I want to add custom mark.js options, such as wildcard search, but it only works when I trigger the search manually.

$("#example").mark("R*os", {
    wildcards: "enabled",
    caseSensitive: true
});

Using the same settings to initialize the DataTable, the search functionality in the search field is not working when typing.

var table = new DataTable('#example',
 { mark:
    {  wildcards: "enabled",
      caseSensitive: true
    }
 }                         
);

Answers

Sign In or Register to comment.