Conservative Design Example: Hierarchical Options

Welcome, one and all, to the second installment of actual code examples for the Conservative Design series. The decision was made (by me) to rename the component in question from the original Hierarchical Select to Hierarchical Options, due to the fact that the hierarchy can consist of any multiple option component, and is not limited to just a select. And to this face, this particular component was documented in the original post entitled Conservative Design: Hierarchical Select Boxes.

Hierarchical Options
Click the image above to go to the example.

Notes on the example: The Tree structure is as follows:

  • Primary
    • Secondary

      • Tertiary

        • Quaternary

          • Quinary
      • 2nd Tertiary (is a static element that doesn’t hide)

So without further adieu or out of place french, what do we have? 3 out of 4 requirements and 1 of 2 luxury items.

  • Handles any number of select elements in a linear or tree (luxury item) like structure.
  • Child select elements are optional based on parent selection. Can hide entire div element or display a message stating no options are available.
  • Compliant with the Reset button.
  • Right now only loads from standard HTML markup (not yet from JavaScript or JSON or an XMLHTTPRequest)
  • Only supports Select elements for now, in the future should be abstracted to support Checkbox Lists or any multiple option component.

Outstanding Bugs:

  • Opera button doesn’t reset properly with Reset Button
  • Clicking off of the default and then back onto the default has the original selections downstream (but doesn’t propagate more than one level)
This entry was posted in Interface Design, JavaScript and tagged , . Bookmark the permalink. Both comments and trackbacks are currently closed.
  • Hey! Use the magical power of RSS and Subscribe! Send me a tweet or a pull request!
  • Zach Leatherman is a Professional Front End Engineer. He loves building for the web and has been writing here since 2007. Feel free to stalk his résumé.

    He enjoys spending time with his beautiful wife Traci and their two Great Danes, Roxie and Ella. They also have a cat, a rabbit, goldfish, two poison dart frogs, and usually one or more tarantulas. Read more »