在和不在条件下,多个值无法使用查询生成器



这是我的运算符配置(为简洁起见,保留其他类型(

operators: [
......
{type: 'in', nb_inputs: 1, multiple: true, apply_to: ['string', 'number', 'datetime']},
{type: 'not_in', nb_inputs: 1, multiple: true, apply_to: ['string', 'number', 'datetime']},
.......
],

"类别"过滤器定义为

filters: [ {
id: 'category',
label: 'Category',
type: 'integer',
input: 'text',
values: {
1: 'Books',
2: 'Movies',
3: 'Music',
4: 'Tools',
5: 'Goodies',
6: 'Clothes'
},
operators: ['equal', 'not_equal', 'in', 'not_in', 'is_null', 'is_not_null']
}]

当我选择"in"作为运算符时,我应该能够选择多个值,但它不允许我。

我的意思是,在条件中和不在条件中的多个值,数据类型为双精度和整数,它不允许逗号分隔符。

如何解决这个问题?请有任何想法。

根据这个问题和相关问题,这个问题还没有解决。只有一种促使您使用字符串字段的解决方法存在:

$('#builder').queryBuilder({
  filters: [
    {
      id: 'name',
      type: 'string',
      value_separator: ','
    }
  ]
});

它可以与版本 2.4.0 一起使用。

我会在这个问题上提出一个适当的解决方案,你可以遵循它。

问候。

最新更新