开发者

Number of items in a combobox in Flex

开发者 https://www.devze.com 2022-12-27 12:22 出处:网络
HI开发者_开发问答, How do i retreive the total number of items (count) of a combo box in Flex?random idea for you:

HI开发者_开发问答, How do i retreive the total number of items (count) of a combo box in Flex?


random idea for you:

var dp : Object = combobox.dataProvider ;
if(dp is Array)
{
    //do something cool
}
else if(dp is ArrayCollection){
    //do something equally as cool
}

etc...


I've confirmed that this will work:

(comboBox.dataProvider as ArrayCollection).length


Try using:

combobox.collection.length

where combobox is the combobox you are using

I'm not sure this will work though. You may need to subclass the control because collection is a protected member :(


The dataprovider of combobox is an arraycollection. You can use the length property to count the number.

0

精彩评论

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