Providing alternative search data to Datatables JS

Viewed 8

We have a table that contains a user's email address, their first name and last name and some date columns. The standard search works great for those.

I would like to provide a way of the user being searchable by their user id which is a GUID. The user id is not a visible piece of data. This search would really only be used by admins

I know I could use the data-search attribute on the user name column e.g.

data-search="43b30438-e3c8-4e27-8b31-5fcc52e53a3b me@test.com"

However that makes that row and any other row findable with just the number "43" as that GUID starts with 43 or "52" because it has a 5 followed by an 2. That is clearly not what I want. How do I make the users searchable by their GUID as well as their username but in the case of the GUID only when it is the whole GUID being searched for?

Thanks

0 Answers
Related