Skip to content
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

w2grid search operator issue #2158

Open
ralonsoreyes opened this issue Nov 26, 2021 · 0 comments
Open

w2grid search operator issue #2158

ralonsoreyes opened this issue Nov 26, 2021 · 0 comments

Comments

@ralonsoreyes
Copy link

Short description
When I try to call the function "search" of w2grid the input parameter operator is not used

What is current behavior
The operator by default is always used.

line 4120, 4121

if (typeof data.value == 'number') data.operator = this.defaultOperator.number
if (typeof data.value == 'string') data.operator = this.defaultOperator.text
if (Array.isArray(data.value)) data.operator = this.defaultOperator.enum
if (w2utils.isDate(data.value)) data.operator = this.defaultOperator.date

What is desired behavior

if (typeof data.value == 'number') data.operator ? data.operator : this.defaultOperator.number
if (typeof data.value == 'string') data.operator ? data.operator : this.defaultOperator.text
if (Array.isArray(data.value)) data.operator ? data.operator : this.defaultOperator.enum
if (w2utils.isDate(data.value)) data.operator ? data.operator : this.defaultOperator.date

Steps to reproduce or sample
1.- Create w2grid object

2.- Use search method:

w2gridtest.search(
[
{ field: 'fname', value: 'lu', operator: 'is', type: 'text' }
]
);
3.- "operator" "is"... is not used

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

1 participant