Skip to content

bRegex error #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
linojon opened this issue Jan 9, 2012 · 3 comments
Open

bRegex error #9

linojon opened this issue Jan 9, 2012 · 3 comments

Comments

@linojon
Copy link

linojon commented Jan 9, 2012

I encountered an error where the search text input was generating a string like
search[last_name_or_first_name_or_middle_namefalse]=L

i think it was trying to generate
search[last_name_or_first_name_or_middle_name_sw]=L

In the file simple_datatables.js.coffee, bRegex is initialized to false, and then line 71 says
op = bRegex ? "_contains" : "_sw"
which compiles to
op = bRegex != null ? bRegex : {
"_contains": "_sw"
};
so the next line
data.push({
name: "search[" + searchcolumns.join("or") + op + "]",
value: sSearch
});
appends "false".
The following change seems to fix the problem
// op = bRegex ? "_contains" : "_sw"
if (bRegex)
op = "_contains"
else
op = "_sw"

@sio4
Copy link

sio4 commented Jan 27, 2012

I met same problem, and I check coffee's syntax.

if I finally want,

op = bRegex ? "_contains" : "_sw"

coffee's is...

op = if bRegex then "_contains" else "_sw"

please fix this so I can remove quick-and-dirty workaround on script on view, like

"oSearch"   : { "sSearch": "", "bRegex": "_contains" }

@wliment
Copy link

wliment commented Feb 10, 2012

the bug affect me

@tones95
Copy link

tones95 commented Feb 11, 2012

this bug affects me as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants