fnFilter with exact match breaks with + < > \ special characters, how to query?
fnFilter with exact match breaks with + < > \ special characters, how to query?
I am using the Multi Filter select, but want to also an exact match in the inputs:
have a http://datatables.net/release-datatables/examples/api/multi_filter_select.html
[code]oTable.fnFilter( $(this).val(), i );[/code]
This works for non-exact matches.
I want an exact match, so if A is selected, only the first row would display. If A + is selected, only the third row, if B is selected, only the second row, and so on. I am using the datatables plugin.
Example Data:
A
B
A +
A + B
A + B
I have altered the query to include a RegEx with RegEx enabled, and disabled the Smart Filter, which is working perfect for every input as expected.
This works perfectly, except certain values will break the RegEx:
[code]oTable.fnFilter("^"+$(this).val()+"$", i, true);[/code]
The characters +, <, >, \ break my exact query, but are allowed in the original query... but they do not do an exact match.
Any suggestions for a character-proof exact match filter?
have a http://datatables.net/release-datatables/examples/api/multi_filter_select.html
[code]oTable.fnFilter( $(this).val(), i );[/code]
This works for non-exact matches.
I want an exact match, so if A is selected, only the first row would display. If A + is selected, only the third row, if B is selected, only the second row, and so on. I am using the datatables plugin.
Example Data:
A
B
A +
A + B
A + B
I have altered the query to include a RegEx with RegEx enabled, and disabled the Smart Filter, which is working perfect for every input as expected.
This works perfectly, except certain values will break the RegEx:
[code]oTable.fnFilter("^"+$(this).val()+"$", i, true);[/code]
The characters +, <, >, \ break my exact query, but are allowed in the original query... but they do not do an exact match.
Any suggestions for a character-proof exact match filter?
This discussion has been closed.
Replies
Allan