Cascading dropdown in filter

lori19

Active Member
Hello fellow Fabrikans!

Here's one that is keeping me busy right now. Maybe you encountered it too and have some ideas.

I have a cascading dropdown element that I also want to use in the filter option. Only it shows no values to select - until you choose also a value for the element that the CDD is watching. This makes perfect sense, as the form was set up this way. My issue is that the users don't remember this they just want to filter with the CDD. From their perspective, it ts simply not working.

What I'm looking for is a way to alert the users that they have to first choose a value for the watched element. Maybe a kind of tip inside the filter? Or some fallback/default value for the watched element in case of filtering?

Any other ideas?

Thanks!
Lorenz
 
You could set a custom "Please select" text.

But there seems to be an issue with CDD filters anyway: If a "Please select" value is set (which has to be done at moment to force an integer for saving to DB) this value is used for filtering.

Did you consider to use a dbjoin with ajax update instead of CDD?
 
Hello

Thanks for the tip with the dbjoin and the ajax update. After some experimenting I made it work.
I used the data where clause to narrow down the dropdown selection then the filter where clause to open it back up.

However, there seems to be some strange behaviour, and I'm not sure that the filter where is working correctly, possibly the overwriting of the join where clause (it is still marked as a work in progress):
- when I don't set it, the join where clause is ignored in the filter and the filter is empty
- when I hardcode the filter where clause (tablename___elementname = "example"), the filter works fine
- when I replace the "example" with a placeholder (normal or raw) the filter remains empty

So my solution was to hardcode the filter where clause to 1=1 to get the full selection.

Kindly,
Lorenz
 
when I replace the "example" with a placeholder (normal or raw)
Yes. You can't use element placeholders here (no idea if "fix" ones like {$my->id} are replaced, never tried).

And I think there's no watch/ajaxupdate on filter-where.
So 1=1 is fine.
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top