mistic100 / jQuery-QueryBuilder

jQuery plugin offering an interface to create complex queries
https://querybuilder.js.org
MIT License
1.68k stars 552 forks source link

comma separated column search #918

Closed halatef closed 2 years ago

halatef commented 3 years ago

how can i search within comma separated column, what type of field uses find_in_set() to search?

mistic100 commented 3 years ago

you can add your ownoperators https://querybuilder.js.org/index.html#operators

and configure them for the sql plugin https://querybuilder.js.org/plugins.html#sql-support => Operators section
just define sqlOperators in your conf to add the new operators
each sql operator must have an "op" property using "?" has placeholder and an optional "sep" to join multiple values

specific operators can be attached to each filter https://querybuilder.js.org/index.html#filters => operators option

halatef commented 3 years ago

you can add your ownoperators https://querybuilder.js.org/index.html#operators

and configure them for the sql plugin https://querybuilder.js.org/plugins.html#sql-support => Operators section just define sqlOperators in your conf to add the new operators each sql operator must have an "op" property using "?" has placeholder and an optional "sep" to join multiple values

specific operators can be attached to each filter https://querybuilder.js.org/index.html#filters => operators option

thanks for ur replay, i could make the customer type and i displayed it in the builder, but i can not find the file in which i will add the custom function to make the operator find_in_set

could u plz help me

mistic100 commented 3 years ago

I don't understand what you want.

halatef commented 3 years ago

here's an example { type: 'geo', optgroup: 'custom', nb_inputs: 3, multiple: false, apply_to: ['number'] }

in which file i will add "geo" and make it return find_in_set() sql function

mistic100 commented 3 years ago

None, you don't modify the source code of the lib. Everything is configurable. That's why I said above

just define sqlOperators in your conf to add the new operators

example https://github.com/mistic100/jQuery-QueryBuilder/issues/920#issuecomment-868427246