开发者

Number of items in a combobox in Flex

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜