Is there a way to change a secondary set of options based upon a prior select?

Is there a way to change a secondary set of options based upon a prior select?

rmeetinrmeetin Posts: 81Questions: 20Answers: 0

Let's say that you're building some sort of problem tree. You provide the administrator with a select option:

  • Animals
  • Vegetables
  • Minerals

If he/she selects animals the editor form reveals options related to Animals:

  • hemisphere
  • habitat
  • color
  • endangered

Vegetables:

  • color
  • carbohydrates
  • vitamins
  • child-friendly

Minerals

  • rare
  • precious
  • mallable

Is this possible with DTE? If yes can you point me to an example?

Answers

  • colincolin Posts: 12,948Questions: 0Answers: 2,206

    I'm sorry, but I'm not clear how this relates to DataTables? Are you referring to some method to filter the table?

    Colin

  • rmeetinrmeetin Posts: 81Questions: 20Answers: 0
    edited March 11

    In datatables editor you offer select for choosing items from a list. You want the form to be smart and concise. The user/administrator chooses animals from the select.

    Rather than displaying/offering options relevant to all 3 including vegetables and minerals, once animals is selected it will only display the next select that sisters with animals:

    1. hemisphere
    2. habitat
    3. color
    4. endangered

    This helps keep the form shorter and reduces confusion. This is somewhat similar to choosing countries, then drawing in from the regions relevant to the selected country.

  • colincolin Posts: 12,948Questions: 0Answers: 2,206

    You could use dependent for that, something like this example here. Or possibly a change event as discussed in this thread - see Allan's answer towards the end,

    Colin

Sign In or Register to comment.