I have a request for a group of dropdown lists with complex filtering in the lists. The issue is that they don't want any previously selected options to be erased when filtering. My actual list can have thousands of options but for the sake of example I'm going to make it shorter:
Let's say the lists are called "favorite fruit 1" and "favorite fruit 2". Someone already chose "Banana" in favorite fruit 1. Now they want to filter the options by "Color: Red" and "Fiber: above 4g". They want the selected option for favorite fruit 1 to remain "Banana" but the list of options available for favorite fruit 1 and 2 to both contain only fibrous red fruits. (Again, I over simplified it for example. This makes more sense when you have thousands of options). Is there a way to do this?
The layout would be something like this:
<select id="color"></select>
<select id="fiber"></select>
<select id="fruit1" value="1"></select> <!--Bananas is selected-->
<select id="fruit2"></select>
My dataSource would be something like this:
[
{
fruitId: 1,
fruitName: "Banana",
color: "Yellow",
fiber: "below 4g",
potassium: "high"
},
{
fruitId: 2,
fruitName: "Apple",
color: "Red",
fiber: "above 4g",
potassium: "low"
},
...
]