Skip to main content

Posts

Showing posts with the label Flex ArrayCollection

Use FilterFunction in Flex ArrayCollection

Here is the simple Flex ArrayCollection FilterFunction example to ignore blank records (name) form arrayCollection. var ac=new ArrayCollection(); ac.addItem({name:'abc'}); ac.addItem({name:'xyz'}); ac.addItem({name:''}); ac.addItem({name:'dac'}); // use of fillter function ac.filterFunction = function(item:*):Boolean{ return (StringUtill.trim(item.name)!=""); // } ac.refresh(); Now filtered ArrayCollection object use further code.

Dynamic ArrayCollection Using Flex

Creating Dynamic Array Collection Using Flex. var ob:Object; var n:String = "Name"; var a:String = "Address"; var ar:ArrayCollection = ""; ob = new Object(); ob[n] = "Ar"; ob[a] = "xyz, UK"; ar = new ArrayCollection(); ar.addItem(ob); ArrayCollection filterfunction