Conditional Element Filters (Cascading Drop Downs)

Hi there,

Just wanted to throw my use case out there to see what you think, so that I can set this up in the right way.

We have a list of hotels. Each hotel has a region (europe, latin america, north america, etc.), city, state, etc. as elements within the list.

We have the list set to require filtering to show results (so initially, no results are shown); however, the user is supposed to first select a region, then select a city. The problem is that the cities are obviously operating independently of the regions at this point, so there is nothing conditional about them; however, there needs to be.

Therefore, my thought is that the filtering should be based on a database join (regions) and cascading drop down element (cities). However, the tutorial for setting this up uses multiple lists to pull data from...

Given that the admin has all this data in just on spreadsheet, there is only just one list (aforementioned). Not sure if we *have* to setup multiple lists to accomplish the conditional filters, or if we can just do it all from the original, single list? (suggestions / feedback on this are welcomed)

If we have to do it as separate lists to get the conditional filtering, how would we set up the other lists so that we can dynamically pull the info into them from the original, single list? (suggestions / feedback on this are welcomed)

Thanks much in advance for your thoughts and feedback on this!

Cheers

Kyle
 
You are better off using separate tables which will have to be imported into Fabrik. There is a way of doing it with a single list but I've never seen positive results with it. With a single list you have to make a text value the PK and I worked on a site that really slowed down because of it.

There are loads of these examples out the the web, I use one here on my demo site. http://fabriking.com/ccd/about-cascade-dropdowns-ccds -- Although it looks like something has broken on it, LOL. I'll fix that later.

I thought we used to have a file in the fabrikar downloads for this sort of thing. Let me know if you have trouble finding something and I'll dump my tables for you.
 
Hey there felixkat, thanks for the follow up! I was assuming this would be the case. The hard part is that it's not a full list of regions, states, etc... And they technically just have a master spreadsheet of hotels that they work with. I'm going to try and get this working with a single list and a text value as I did before (unsuccessfully, of course), and see what happens.

Thanks again!
 
You should be able to do it, using a join element to your single table for the "Regions" using the 'region' as both the value (key) and label (as opposed to the usual technique of using the numeric PK of the table as the key for the join) and a CDD which then uses the 'region' field as the foreign key. The problem being, as Felix pointed out, is that things can slow down. We *should* automatically create an index on your table for anything you use as the value (key) of a join element ... but I have seen cases where that index creation fials, for reasons I don't quite understand (but I think have to do with collation).

All that said ... our CDD element was pretty much designed with normalized tables in mind, so the CDD would reference a separate table, with a sinple FK -> PK arrangement (like city.state_id (FK) -> state.id (PK)). So using a single monolothic table always runs the risk of running in to untested (and broken) usage cases.

-- hugh
 
As for how to process you spreadsheet in to separate, normalized files ... that's outside our scope.

-- hugh
 
Back
Top