Multiple drop down lists filtered in repeater

Hi!

Another way to do this is using the “facet filters” method described here. That example uses checkboxes, but the method is even simpler with dropdowns like you have. (You could use checkmarks if you wanted to give the ability to show, say, all Transfers and Certificates for both Business and Medical.)

The advantage is that you don’t need any IF/Then/Else logic. You basically set up two filters when the page loads, making sure both filters are active at the same time. (I.e., don’t check “remove other filters” when you set up the second filter.)

The two filters look like this. You can add them OnLoad (not OnItemLoad) of the repeater.

[[LVAR_dropdown1 == “All” || LVAR_dropdown1 == Item.area_of_study]]

[[LVAR_dropdown2 == “All” || LVAR_dropdown2 == Item.program_type]]

When the filters are combined, they winnow down each other. Note that both filters return true for every row if the value is “All,” so you don’t need any logic in your dropdown code to test for that. (The “||” means OR.) If you needed a third dropdown, you’d just add third filter for it.

Then, just force those filters to re-evaluate when you change the selection on the dropdowns. Here is the code for each dropdown.

OnSelectionChange
   Set Items per Page of (repeater) to Unlimited

Attached: facet-filters-with-dropdowns.rp (14.6 MB)

1 Like