3 Replies Latest reply on Apr 8, 2009 8:34 PM by Flex harUI

    Help with Searching a Datagrid

    Kurrykid Adobe Community Professional

       

       

       

       

       

       

       

       

       

       

       

       

       

       

      I am using the below code to search through a datagrid which is working fine.  However, I want to search through more than one column and I can't seem to figure out the syntax.  Can anyone help?

       

      It is the city field (highlighted in red below) that tells it to only look at the one column...anyone know how to make it look at several columns?

       

      Thanks.

       

      Dave

       

       

       

      private

      function onResult(evt:ResultEvent):void

      {

       

       

           var sort:Sort = new Sort();

           sort.fields = [

      new SortField("city",true) ];

       

       

           this.homesForSale = evt.result.data.region;

       

       

           this.homesForSale.sort = sort;

       

       

           this.homesForSale.refresh();

       

       

           this.cursor = this.homesForSale.createCursor();

      }

       

       

       

      private function searchCity():void

            {

       

       

           if(search_ti.text != "") {

       

       

           if(this.cursor.findFirst({city:search_ti.text})){

       

       

           var idx:int = this.homesForSale.getItemIndex(this.cursor.current);

       

       

           this.grid.scrollToIndex(idx);

       

       

           this.grid.selectedItem = this.cursor.current;

      }

      }

      }