Flex 4:以编程方式将项添加到下拉列表中

时间:2010-10-14 13:14:27

标签: drop-down-menu flex4

我想以预定方式将项目添加到下拉列表中。

我有一个空的下拉列表,根据许多因素,我会用各种动作选项填充它。

下拉列表被称为dlFirstChoice,我想为它添加一些值,有些人可以给我基本的代码,我已经厌倦了IList和Arrays作为Dataprovider,但显然我做错了。 / p>

请提前感谢您的帮助。

1 个答案:

答案 0 :(得分:0)

 var dropListDb:ArrayList=new ArrayList();
     dropListDb.addItem({label: "Equals (List)"});
     dropListDb.addItem({label: "Is Between"});
     dlFirstChoice.visible = true;
     dlFirstChoice.dataProvider=dropListDb;
     dlFirstChoice.selectedIndex=0;