jQuery-QueryBuilder icon indicating copy to clipboard operation
jQuery-QueryBuilder copied to clipboard

Free input for filter selection

Open devdon opened this issue 5 years ago • 7 comments

Perhaps I've overlooked the documentation or various examples, but I'd like to use a free-form text input as the filter input. In other words, at runtime, the user can freely type in the filter value as opposed to selecting from a pre-defined list presented in a select list.

I've tried:

  • Rule templates: 'custom' placeholder filter, and a custom rule filter (mixed results; struggled with the placement of the operators select)
  • Augmenting the UX by presenting an additional form in order to inject custom filters at runtime (adds unnecessary steps)

Any pointers are greatly appreciated.

devdon avatar Aug 28 '19 18:08 devdon

Just use type: 'string' ?

As an example: check the name field at this demo: https://querybuilder.js.org/demo.html#plugins

Guite avatar Aug 28 '19 18:08 Guite

Just use type: 'string' ?

As an example: check the name field at this demo: https://querybuilder.js.org/demo.html#plugins

It's my understanding that specifying the type drives the operators list within the rule. Perhaps I need to be more clear on what I'm attempting.

There are three basic components to a given rule:

  1. Filter
  2. Operator
  3. Value

The filter is presented as a dropdown menu. The list contents are predefined at configuration or further modified at runtime. This works great when your list of filters are known.

My challenge is that the filters (and their types) are not known. The user will enter an arbitrary filter, including assigning it a type.

I'm currently exploring overriding the 'filterSelect' template, but this raises some additional challenges. Thus far, I have added an input element, wherein you see in a given rule. I'm not challenged with extracting the value of input-text, and outputting in the JSON. Similarly, importing a rule set, and presenting it in the desirable template.

In short, I don't know if there's an easier solve. I'm open to suggestions.

Thank you.

devdon avatar Aug 28 '19 20:08 devdon

The lib does not provide this functionallity, which is quite similar or linked to #576 and #653

As you could have seen, the developped is quite paused for now.

mistic100 avatar Aug 29 '19 17:08 mistic100

Hi @mistic100 could you tell me when you will implement this feature ? Actually I need this feature soon. thancks,

ghaderhp avatar Dec 29 '21 07:12 ghaderhp

Probably never

Sent from MailDroid

-----Original Message----- From: Ghader Hosseinpour @.> To: mistic100/jQuery-QueryBuilder @.> Cc: Damien Sorel @.>, Mention @.> Sent: mer., 29 déc. 2021 8:18 Subject: Re: [mistic100/jQuery-QueryBuilder] Free input for filter selection (#814)

Hi @mistic100 could you tell me when you will implement this feature ? Actually I need this feature soon. thancks,

-- Reply to this email directly or view it on GitHub: https://github.com/mistic100/jQuery-QueryBuilder/issues/814#issuecomment-1002431129 You are receiving this because you were mentioned.

Message ID: @.***>

mistic100 avatar Dec 29 '21 08:12 mistic100

This would be amazing to have. Literally the only thing stopping me from using it. Does anyone know of any other libraries similar to this that support this type of functionality?

Joshmamroud avatar Apr 22 '22 05:04 Joshmamroud

added support for input as a filter

check out my fork here

https://github.com/sematgt/jQuery-QueryBuilder

all changes needed are in this commit fdf4ac90140cae39e01a2d4b8460aa818b977046

now you can simply pass [] as filters and filter select becomes input

image

also you can edit input filter in core.js

sematgt avatar Mar 27 '24 16:03 sematgt