-
Notifications
You must be signed in to change notification settings - Fork 552
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
use of SQL operator "IN" #43
Comments
I can't reproduce are you using the last upstream ? what are your filters ? |
I added a unit test in #3b0352f493 |
Same problem here // also impossible to use IN operator with integers ... |
Are you willing to give details about your config or not ? |
This one shows how IN operator doesn't quote every item separately as mentionned above by giessebi: This one shows how IN operator doesn't allow a list of integers : |
this is not an intended usage, you can use a simple text input with IN operator if you provide the |
I prefer to stick to this highly customizable way, rather than impose comma as separator (or even add a parameter for that) |
Hi, |
I have the following Selectize and it doesn't quote string the individual values. Do I needed a custom valueGetter to get values like IN('1415','1516') id: 'fayr',
label: 'FAYR',
type: 'string',
plugin: 'selectize',
plugin_config: {
valueField: 'value',
labelField: 'name',
searchField: 'name',
options: [],
create: false,
maxItems: 3,
plugins: ['remove_button'],
load: function (query, callback) {
if (!query.length) return callback();
$.ajax({
url: '/api/ASC_SearchQuery',
type: 'GET',
dataType: 'json',
error: function () {
callback();
},
success: function (res) {
callback(res);
}
});
}
},
valueSetter: function (rule, value) {
console.log(rule);
rule.$el.find('.rule-value-container input')[0].selectize.setValue(value);
} |
yes you need to customize the valueSetter, and also the valueParser |
Version 2.4.0 added $('#builder').queryBuilder({
filters: [
{
id: 'name',
type: 'string',
value_separator: ','
}
]
}); |
When you use IN it would be logical to specify more than one argument (comma separated).
The SQL parser gives out a wrong result, though: if you specify IN a,b, the resulting query fragment reads as IN('a,b') which would search for a single argument instead of two.
I realize you may want to allow users to look for commas (but they could escape commas, couldn't they?), however a useful IN option should output more than one argument as IN('a','b','c'...)
The text was updated successfully, but these errors were encountered: