Multi-select droplist with checkboxes and indented subcategories

repeater-widget
newbie-question
advanced-prototyping

#1

I’m trying to create a droplist such as the one below that has multiple features:

  • multi select
  • checkboxes
  • select all
  • category level selection to select only the items in that category
  • displays all of the options selected in the dropdown field, truncated when several have been selected

I’ve been working at this for days and can’t seem to get it to work the way I need it to. Looking to my seasoned peers for help. Thanks

droplist.rp (86.5 KB)


#2

Hello, this is solution for “de/select all”. But Iam not sure, if it is easiest way
droplist update.rp (93.0 KB)


#3

Thanks melibrion. This gets me part of the way there.

I also need to be able to select groups. For instance, if I select “Produce” I want Apples, Oranges, Carrots and Celery to also be selected. And when I deselect any individual item within the list, the “Select All” should also be deselected (because now I don’t actually have them all selected.)


#4

Hi!

The difficulty here is not checking a checkbox and then have its children checked, because OnItemLoad runs through rows top to bottom, and you can flag a variable upon hitting a top-level checkbox to know that subsequent non-top-level checkboxes need to be checked until the next parent is hit. The hard part is checking/unchecking a parent checkbox. This would be easy if you could make OnItemLoad run backwards, but it doesn’t

Is there a reason you are using a repeater for this? It would be much easier if you just created sets of parents and children, each with a hidden v_checkedCount label that gets incremented/decremented when child checkboxes are checked. After incrementing, you can check if the count matches the number of child checkboxes and if so check the parent.

I’m certain this can be done with a repeater, but it would be very complex.


#5

I needed to do something similar to your situation a while back: Nested_Indeterminate_Selection.rp (648.8 KB)

I apologize for a hasty response; I’m swamped right now. Hopefully you can reverse-engineer something useful out of it. You’re welcome to ask questions, if you’re OK with the possibility of waiting a day or two for a response. :grin: