开发者

Flex - combobox data

开发者 https://www.devze.com 2023-03-29 20:41 出处:网络
I\'d like to create a combobox which will get users from an arrayList & another field for creating a new user.

I'd like to create a combobox which will get users from an arrayList & another field for creating a new user.

for example when i open the combobox i'd like to see the r开发者_StackOverflow中文版ows :

Create new user

User A

User B

where the users come form an arrayList and the "create new user" option is always there.

How can I do it?

P.S

I don't wan't to add "create new user" obj to the arryList - so this is not a desired solution.

Thanks for your help,

Dan


Just create an intermediate ArrayList, add the "create new user" option to it, copy all the elements from the other ArrayList, and finally assign it to the combobox:

var cbArray = new ArrayList();
cbArray.push("Create new user ");
for (int i = 0; i < yourArrayList.lenght; i++) {
    cbArray.push(yourArrayList[i]);
}
// Then assign cbArray to the combo box
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号