bStateSave and backslashes
bStateSave and backslashes
shiftymccool
Posts: 19Questions: 1Answers: 0
Hello,
I've come across an issue with bStateSave retrieving values with backslashes. I'm using yadcf to filter columns, which works fine until I use search terms with backslashes (like regex).
When oData.aoSearchCols[key].sSearch = ^(401k|Compensation)$ state is loaded after a refresh without issue. When the value is something like ^(Candidate\ Email\ \(System\))$ no state is loaded, including column sorting, etc...
I've worked around this issue by doing some string manipulation in the fnStateSaveParams and fnStateLoadParams, but it feels like I'm missing something simple. I thought setting aoSearchCols: bEscapeRegex would help, but either it doesn't or I did it wrong.
Can you offer any advice? Let me know if there's more info that I can provide.
Thanks!
I've come across an issue with bStateSave retrieving values with backslashes. I'm using yadcf to filter columns, which works fine until I use search terms with backslashes (like regex).
When oData.aoSearchCols[key].sSearch = ^(401k|Compensation)$ state is loaded after a refresh without issue. When the value is something like ^(Candidate\ Email\ \(System\))$ no state is loaded, including column sorting, etc...
I've worked around this issue by doing some string manipulation in the fnStateSaveParams and fnStateLoadParams, but it feels like I'm missing something simple. I thought setting aoSearchCols: bEscapeRegex would help, but either it doesn't or I did it wrong.
Can you offer any advice? Let me know if there's more info that I can provide.
Thanks!
This discussion has been closed.
Replies
Thanks,
Allan
I'm seeing the variable bRegex in the DataTables debug and it's set to false for these fields. Is there a place to set this to true, and would it help?
Thanks again!
Unfortunately 1.9.x isn't receiving any more updates, so this won't be resolved there unless yourself or some else hacks it in. 1.9.4 is the last planned release for 1.9.x.
Allan
Thanks for the heads-up!