Friday, June 22, 2012

Flex text Filter

Google:

'via Blog this'

.mxml


<s:TextInput prompt="Patient Name Search"
id="myTextInput"
change="filter()"
borderColor="#3B4F78"
width="100%"/>

.as

[Bindable]
public var waitingList:ArrayCollection=new ArrayCollection();

private function filter():void
{
waitingList.filterFunction=filterMyArrayCollection;
waitingList.refresh();
// dataGrid.refresh();
//dataGri.expandAll();
}

private function filterMyArrayCollection(item:Object):Boolean
{
var searchString:String=myTextInput.text.toLowerCase();
var itemName:String=(item.patName as String).toLowerCase();
return itemName.indexOf(searchString) > -1;
}

No comments:

Post a Comment