[英]How to find ArrayList length after filtered in apache royale
此代碼段來自TDJ列表
<j:Card>
<html:H3 text="Jewel List"/>
<j:List id="list" width="200" height="300" dataProvider="{simple}" change="onChange(event)"/>
<j:TextInput width="200">
<j:beads>
<j:TextPrompt prompt="filter list..."/>
<j:SearchFilterForList list="{list}"/>
</j:beads>
</j:TextInput>
<j:Label id="selected" html="{describeItem(list.selectedItem)}"/>
</j:Card>
有j:SearchFilterForList
我想知道的是何時工作(在過濾器文本框中鍵入一些文本),如何查找過濾后的列表長度?
謝謝
只需使用最近添加的新的“ length
”屬性即可。 Tour de Jewel也已更新,並在List示例中顯示了此新珠子屬性的使用。
<j:Label html="{'list filtered length: ' + filter.length}"/>
<j:TextInput>
<j:beads>
<j:TextPrompt prompt="filter list..."/>
<j:SearchFilterForList id="filter" list="{iconList}"/>
</j:beads>
</j:TextInput>
請注意,此珠子執行的過濾只是視覺上的,底層的dataProvider本身並未過濾。 要獲得dataProvider的過濾視圖,您應該使用ArrayListView
API,類似於具有filterFuncion
flex ListCollectionView
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.