How to modify filter string prior to filtering?
How to modify filter string prior to filtering?
Hello DataTables users & developers,
I'm using DataTables to filter a table with many international strings, like "Hrökkbrauð", in it.
If you have a keyboard layout which has no "ö" key, it might be hard to use the search box to find this entry.
So I thought it would be nice, if we had a mapping of plain ASCII to special characters and could then type pure ASCII string and everything with corresponding ASCII and special characters gets found.
E.g.
o => o,ö,ø,ō,...
Then you type "hrok", which gets translated to "hr[o|ö|ø|ō]k" and matches "Hrökkbrauð"".
This essentially means I have to modify the user supplied filter string into a regexp and then use this regexp to filter the table.
Do you have any propositions how to do this most elegantly?
Kind regards.
I'm using DataTables to filter a table with many international strings, like "Hrökkbrauð", in it.
If you have a keyboard layout which has no "ö" key, it might be hard to use the search box to find this entry.
So I thought it would be nice, if we had a mapping of plain ASCII to special characters and could then type pure ASCII string and everything with corresponding ASCII and special characters gets found.
E.g.
o => o,ö,ø,ō,...
Then you type "hrok", which gets translated to "hr[o|ö|ø|ō]k" and matches "Hrökkbrauð"".
This essentially means I have to modify the user supplied filter string into a regexp and then use this regexp to filter the table.
Do you have any propositions how to do this most elegantly?
Kind regards.
This discussion has been closed.
Replies