--- In flexcoders@yahoogroups.com, "anuj181" <[EMAIL PROTECTED]> wrote:

Hi All
This is somehow regarding the question I have asked few weeks back.
Unfortunately I have to stop this task at that time and now need to
work on that. My need is that I have some entries in the List as an
arrayCollection and there is text input box and I like to have list to
filter the data as soon as user starts typing text. I have attached
the so far developed code. I need as soon as user types On, the list
below should only show first entry which is 'One-Device'. I attached
the code but it is not working as I want. This is going to be just my
dummy working prototype and once this module has been made working
then i am going to merge this module into my Main Project.

Also if anyone has any better idea about how to figure this thing out
that will be great and instead of arrayColection if we can achieve the
same function laity that would be helpful too.
Thanks a lot
Anuj 

/******************CODE****************************/
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; 
        layout="absolute"
        initialize="init()" 
        width="100%" height="100%"
        horizontalScrollPolicy="off">
<mx:Script>
                <![CDATA[                       
                        
            import mx.managers.PopUpManager;
            import mx.effects.DefaultTileListEffect;          
            import mx.rpc.events.ResultEvent;
            import mx.controls.Alert;
            import mx.collections.ArrayCollection;
            import mx.effects.easing.Elastic;
        
            [Bindable]
            public var ac:ArrayCollection = new
ArrayCollection(["One-Device","Two-Device","Three-Device","Four-Device","Five-Device","Six-Device"]);
          
            [Bindable]
            public var filterText:String = '';
                                
                        private function doChange():void
            {
                this.filterText = txtSearch.text;
                this.ac.refresh();
            }
            
            private function init():void
            {
                ac.filterFunction = processFilter; 
            }
            private function processFilter(item:Object):Boolean
            {
                var result:Boolean=false;
                if(!DevicesList.labelField.length ||
DevicesList.labelField.toUpperCase().indexOf(this.filterText.toUpperCase())>=0)
                result=true;
                
                return result;
            }
            private function seeLabel(evt:Event):void
            {
                var alrt:Alert=Alert.show(evt.currentTarget.toString());
            }

                ]]>
</mx:Script>
        <mx:List x="74" y="228" width="229" height="238" dataProvider="{ac}"
id="DevicesList"></mx:List>
        <mx:TextInput x="74" y="198" id="txtSearch" change="doChange()"/>
        
        
</mx:Application>

--- End forwarded message ---


Reply via email to