Skip to main content
edited tags
Link
Christophe
  • 82.2k
  • 11
  • 136
  • 202
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

I want to implement dependent drop-down feature on a web page in my website containing the following drop-downs:

  1. User's group name
  2. Group events (dependent drop-down)
  3. Locations (dependent drop-down)

Now, what I want is according to the selected option in the first drop-down that is group name (the other two will be disabled until it is selected), the list of events is displayed; only those values relevant to the selected group name should occur. Similarly, the values of locations should be in relevance to the group name and the event selected. Not only this, but I also want the design to be irrelevant of the level of dependencies or the current order (group name->events->locations). Even if I wish to add timings as another level of dependency, the design should incorporate it.

Now, in all the related questions to this problem tables are used to store data in databases like:

However, I wish to consider the following alternatives:

  1. Trie: Since the order in which the attributes are selected is defined, we could use a trie to store all possible combinations of the list of values in each drop-down dependent on each other. Using prefix search, we could retrieve the values of the next drop-down, according to value selected in the previous one.
  2. Table: similar to one used in above, we can store it in database but then the number of levels of dependencies are not really fixed and can increase in future. How do I handle that? (Assuming I don't want to modify the schema every time this happens)
  3. Graph: We could also store the possible combinations in a directed graph and based on the values selected we can display all the next adjacent nodes int he next dependent drop-down.

Which of these is a best approach, keeping in mind future extensibility or changes? Or any other suggestions for data structures are also welcomed. Please explain with proper design in detail considering complexity in mind.

I want to implement dependent drop-down feature on a web page in my website containing the following drop-downs:

  1. User's group name
  2. Group events (dependent drop-down)
  3. Locations (dependent drop-down)

Now, what I want is according to the selected option in the first drop-down that is group name (the other two will be disabled until it is selected), the list of events is displayed; only those values relevant to the selected group name should occur. Similarly, the values of locations should be in relevance to the group name and the event selected. Not only this, but I also want the design to be irrelevant of the level of dependencies or the current order (group name->events->locations). Even if I wish to add timings as another level of dependency, the design should incorporate it.

Now, in all the related questions to this problem tables are used to store data in databases like:

However, I wish to consider the following alternatives:

  1. Trie: Since the order in which the attributes are selected is defined, we could use a trie to store all possible combinations of the list of values in each drop-down dependent on each other. Using prefix search, we could retrieve the values of the next drop-down, according to value selected in the previous one.
  2. Table: similar to one used in above, we can store it in database but then the number of levels of dependencies are not really fixed and can increase in future. How do I handle that? (Assuming I don't want to modify the schema every time this happens)
  3. Graph: We could also store the possible combinations in a directed graph and based on the values selected we can display all the next adjacent nodes int he next dependent drop-down.

Which of these is a best approach, keeping in mind future extensibility or changes? Or any other suggestions for data structures are also welcomed. Please explain with proper design in detail considering complexity in mind.

I want to implement dependent drop-down feature on a web page in my website containing the following drop-downs:

  1. User's group name
  2. Group events (dependent drop-down)
  3. Locations (dependent drop-down)

Now, what I want is according to the selected option in the first drop-down that is group name (the other two will be disabled until it is selected), the list of events is displayed; only those values relevant to the selected group name should occur. Similarly, the values of locations should be in relevance to the group name and the event selected. Not only this, but I also want the design to be irrelevant of the level of dependencies or the current order (group name->events->locations). Even if I wish to add timings as another level of dependency, the design should incorporate it.

Now, in all the related questions to this problem tables are used to store data in databases like:

However, I wish to consider the following alternatives:

  1. Trie: Since the order in which the attributes are selected is defined, we could use a trie to store all possible combinations of the list of values in each drop-down dependent on each other. Using prefix search, we could retrieve the values of the next drop-down, according to value selected in the previous one.
  2. Table: similar to one used in above, we can store it in database but then the number of levels of dependencies are not really fixed and can increase in future. How do I handle that? (Assuming I don't want to modify the schema every time this happens)
  3. Graph: We could also store the possible combinations in a directed graph and based on the values selected we can display all the next adjacent nodes int he next dependent drop-down.

Which of these is a best approach, keeping in mind future extensibility or changes? Or any other suggestions for data structures are also welcomed. Please explain with proper design in detail considering complexity in mind.

Fixed various typos and grammatical errors that were missed in the first edit. Updated the titles of the links, as they had subsequently changed since the last edit.
Source Link

Best Data structure for implementation of dependent dropdownsdrop-downs

I want to implement dependent dropdowndrop-down feature on a web page in my website containing the following drop-downs:

  1. User's group name
  2. Group events (dependent drop-down)
  3. Locations (dependent drop-down)

Now, what I want is according to the selected option in the first drop-down that is group name  ( thethe other two will be disabled until it is selected), the list of events is displayed; only those values relevant to the selected group name should occur. Similarly, the values of locations should be in relevance to the group name and the event selected. Not only this, but I also want the design to be irrelevant of the level of dependencies or the current order (group name->events->locations). Even if I wish to add timings as another level of dependency, the design should incorporate it.

Now, in all the related questions to this problem tables are used to store data in databases like:

ButHowever, I wish consideringto consider the following alternatives:

  1. Trie: Since the order in which the attributes are selected is defined, we could use a trie to store all possible combinations of the list of values in each dropdowndrop-down dependent on each other. Using prefix search, we could retrieve the values of the next dropdowndrop-down, according to value selected in the previous one.
  2. Table: similar to one used in above, we can store it in database but then the number of levels of dependencies are not really fixed and can increase in future. How do I handle that? (Assuming I don't want to modify the schema every time this happens)
  3. Graph: We could also store the possible combinations in a directed graph and based on the values selected we can display all the next adjacent nodes int he next dependent dropdowndrop-down.

Which of these is a best approach, keeping in mind future extensibility or changes? Or any other suggestions for data structures are also welcomed. Please explain with proper design in detail considering complexity in mind.

Best Data structure for implementation of dependent dropdowns

I want to implement dependent dropdown feature on a web page in my website containing the following drop-downs:

  1. User's group name
  2. Group events (dependent drop-down)
  3. Locations (dependent drop-down)

Now, what I want is according to the selected option in the first drop-down that is group name( the other two will be disabled until it is selected), the list of events is displayed; only those values relevant to the selected group name should occur. Similarly, the values of locations should be in relevance to the group name and the event selected. Not only this, but I also want the design to be irrelevant of the level of dependencies or the current order (group name->events->locations). Even if I wish to add timings as another level of dependency, the design should incorporate it.

Now, in all the related questions to this problem tables are used to store data in databases like:

But, I wish considering the following alternatives:

  1. Trie: Since the order in which the attributes are selected is defined, we could use a trie to store all possible combinations of the list of values in each dropdown dependent on each other. Using prefix search, we could retrieve the values of the next dropdown, according to value selected in the previous one.
  2. Table: similar to one used in above, we can store it in database but then the number of levels of dependencies are not really fixed and can increase in future. How do I handle that? (Assuming I don't want to modify the schema every time this happens)
  3. Graph: We could also store the possible combinations in a directed graph and based on the values selected we can display all the next adjacent nodes int he next dependent dropdown.

Which of these is a best approach keeping in mind future extensibility or changes? Or any other suggestions for data structures are also welcomed. Please explain with proper design in detail considering complexity in mind.

Best Data structure for implementation of dependent drop-downs

I want to implement dependent drop-down feature on a web page in my website containing the following drop-downs:

  1. User's group name
  2. Group events (dependent drop-down)
  3. Locations (dependent drop-down)

Now, what I want is according to the selected option in the first drop-down that is group name  (the other two will be disabled until it is selected), the list of events is displayed; only those values relevant to the selected group name should occur. Similarly, the values of locations should be in relevance to the group name and the event selected. Not only this, but I also want the design to be irrelevant of the level of dependencies or the current order (group name->events->locations). Even if I wish to add timings as another level of dependency, the design should incorporate it.

Now, in all the related questions to this problem tables are used to store data in databases like:

However, I wish to consider the following alternatives:

  1. Trie: Since the order in which the attributes are selected is defined, we could use a trie to store all possible combinations of the list of values in each drop-down dependent on each other. Using prefix search, we could retrieve the values of the next drop-down, according to value selected in the previous one.
  2. Table: similar to one used in above, we can store it in database but then the number of levels of dependencies are not really fixed and can increase in future. How do I handle that? (Assuming I don't want to modify the schema every time this happens)
  3. Graph: We could also store the possible combinations in a directed graph and based on the values selected we can display all the next adjacent nodes int he next dependent drop-down.

Which of these is a best approach, keeping in mind future extensibility or changes? Or any other suggestions for data structures are also welcomed. Please explain with proper design in detail considering complexity in mind.

Fixed list formatting and inlined the links. Also corrected the first link, based on the OP's same question on SESO.
Source Link
Loading
added 106 characters in body
Source Link
ekjot
  • 21
  • 3
Loading
Source Link
ekjot
  • 21
  • 3
Loading