[英]Number of items in a combobox in Flex
嗨,我如何獲取Flex中組合框的項目總數(數量)?
給您的隨機想法:
var dp : Object = combobox.dataProvider ;
if(dp is Array)
{
//do something cool
}
else if(dp is ArrayCollection){
//do something equally as cool
}
等等...
我已經確認可以使用:
(comboBox.dataProvider as ArrayCollection).length
嘗試使用:
combobox.collection.length
其中, combobox
是您正在使用的組合框
我不確定這是否可以。 您可能需要對控件進行子類化,因為collection是受保護的成員:(
組合框的數據提供者是一個數組集合。 您可以使用length屬性來計算數字。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.