Changing UI dropdown list
Posted: April 20th, 2010, 3:39 am
Hi All,
I'm trying to make a UI where there are two drop down lists. The contents of the second drop down list needs to alter, according to what is selected in the first. Most of the standard Javascript array syntax I've tried doesn't work. Then I found this in another script...
pal.grp.main.aDropDown.add('item', 'hello');
...which successfully adds 'hello' to the end of the list. I extrapolated the syntax to....
pal.grp.main.aDropDown.remove('item', pal.grp.main.aDropDown.items[0]);
...and although it doesn't through an error, it doesn't have any effect either. I've tried setting the length to 0, using splice() and pop() etc. but all to no avail. Now I'm stumped.
How do I do this?
Thanks if you can help.
Ben.
I'm trying to make a UI where there are two drop down lists. The contents of the second drop down list needs to alter, according to what is selected in the first. Most of the standard Javascript array syntax I've tried doesn't work. Then I found this in another script...
pal.grp.main.aDropDown.add('item', 'hello');
...which successfully adds 'hello' to the end of the list. I extrapolated the syntax to....
pal.grp.main.aDropDown.remove('item', pal.grp.main.aDropDown.items[0]);
...and although it doesn't through an error, it doesn't have any effect either. I've tried setting the length to 0, using splice() and pop() etc. but all to no avail. Now I'm stumped.
How do I do this?
Thanks if you can help.
Ben.