Open umpirsky opened 1 year ago
Hi @umpirsky
Sorry for the late response. That's a valid point but would be nice to have it configurable on per grid level. IMO the alternative is an overkill.
Could you open a PR with the changes? Thanks in advance and cheers 🍻
How would config look like? Can you provide an example?
I was thinking of something like:
filters:
exists:
type: exists
default_value: true
But I've dug a bit deeper and that's already possible out of the box, the only problem is there is no correlation between the value set here and the value selected on the form.
With the above config, the criterium gets applied, but the form still says No
.
Again there's a way of configuring the default value of the form, but:
filters:
exists:
type: exists
default_value: true
form_options:
empty_data: '1' # has to be a string
I don't have any good idea ATM how to tackle this or even if it can be solved since the empty_data
set on the form is bound with it and its data transformers, while the default_value
has to be digestible by the filter itself.
Interesting hack, I will give it a shot...
ExistsFilterType
default choice isExistsFilter::FALSE
, but sometimes it makes more sense to beExistsFilter::TRUE
.Describe the proposed solution We can add:
and sort choices accordingly.
Describe alternatives you've considered Alternatively we can add new
DoesNotExistFilterType
to achieve this.I ended up with a simple override to achieve this: