Closed louking closed 5 years ago
Also I think this might be in a couple of places. Search for option[value
check 0.9.4.beta.27 ,
I notice this is an issue in the 0.9.3 version. I've got the beta 28 and still get the following:
Uncaught Error: Syntax error, unrecognized expression: Joshuah O'Brien
at Function.oe.error (jquery-3.3.1.min.js:2)
at oe.tokenize (jquery-3.3.1.min.js:2)
at oe.select (jquery-3.3.1.min.js:2)
at Function.oe [as find] (jquery-3.3.1.min.js:2)
at w.fn.init.find (jquery-3.3.1.min.js:2)
at new w.fn.init (jquery-3.3.1.min.js:2)
at w (jquery-3.3.1.min.js:2)
at parseTableColumn (jquery.dataTables.yadcf.js:2809)
at appendFilters (jquery.dataTables.yadcf.js:3081)
at HTMLTableElement.<anonymous> (jquery.dataTables.yadcf.js:4526)
Also get it if I am not using Select2
I was able to get this to work by altering two lines, but I'm not certain of the total effect of this.
Lines 3323 and 3364
I changed
var optionExists = filter.find("option[value='" + tmpStr + "']").length === 1;
to
var optionExists = filter.find('option[value="' + tmpStr + '"]').length === 1;
this allows content with an apostrophe to go through. For me this works as my filtered content will never contain a quotation mark.
@trf000 please provide a minimal test page so I can check it / your fix
@vedmack
https://codepen.io/trf000/pen/qBByyGW
I'd keep both versions of the line, or better yet, some kind of flag to determine which to use on a given filter. I'll never have a case where i am filtering data that containd double quotes, but I will filter names with single quotes on occasion.
see https://codepen.io/louking/pen/yWRWQK and select New Jersey's using select above table
I saw this in beta 25, but cdn has beta 5 -- this traceback is from beta 5