3 Spinners elements setting up according to selection

I will set the elements of 1th spinner to the states, the second spinners elements to the cities of selected state, and the 3rd spinners elements to the schools of selected city. But I don't know how I set the elements of spinners according to selection.

Did you check this out?

You will need some conditional statements in your afterSelecting events, e.g.

if SpinnerStates.Selection = alabama, set SpinnerCities.Elements = alabama;
else if ......

You will find the number of lists starts to increase exponentially as you cascade. it may be easier to work with a flat csv - e.g.


and filter as you go

or even better set up a relational database in SQLite

1 Like

Here is an old project of mine that deals with a similar problem ...


You can try dictionary mode.. mostly you can solve it. Get 1st key of dictionary in spinner 1, upon selection again take the selected key value of key2 in spinner 2 and upon selecting the item just get the key value of spinner2 to spinner3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.