Exact column matching using individual column filtering with select menus
Exact column matching using individual column filtering with select menus
tr333
Posts: 12Questions: 0Answers: 0
I'm using invidual column filtering with select menus from http://datatables.net/examples/api/multi_filter_select.html, but I've run into a problem. If I have a column with values "Test 1", "Test 2", etc. up to "Test 12", then when I select "Test 1" in the select menu it will filter for "Test 1", "Test 10", "Test 11", "Test 12".
Is there any way to tell DataTables to do an exact match when filtering on a particular column? I suppose I could place the value inside "^$" and set the regex filter mode, but then I would have to escape all the regex reserved characters that might appear in the value. Is there any easier way to do it?
Is there any way to tell DataTables to do an exact match when filtering on a particular column? I suppose I could place the value inside "^$" and set the regex filter mode, but then I would have to escape all the regex reserved characters that might appear in the value. Is there any easier way to do it?
This discussion has been closed.
Replies
Allan
[code]fnFilter( '^' + XRegExp.escape(this.value) + '$', column, true, false );[/code]