0 Replies Latest reply on Aug 12, 2006 6:05 PM by hhr_jb

    DataGrid Filtering on the fly

    hhr_jb Level 1
      Hello,

      Trying to create a datagrid that I can refresh on the fly. I have a xml w/ all the date that get populated inside the datagrid. Beneath are 2 input box (Start and End). By default the start will be set to 1 and the end will be at 100. As the user changes either the start or the end the data in the datagrid should be changing base on the selected range. Is this possible to do?

      So far this is my code.

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="vertical" initialize="myService.send()">
      <mx:Script>
      <![CDATA[
      import mx.collections.ArrayCollection;
      import mx.rpc.events.ResultEvent;

      [Bindable]
      private var myData:ArrayCollection;

      private function resultHandler(event:ResultEvent):void{
      myData = event.result.titles.title;
      }
      ]]>
      </mx:Script>

      <mx:HTTPService id="myService" url="data/videoTitles.xml" result="resultHandler(event)" />

      <mx:DataGrid dataProvider="{myData}" width="400" height="141">
      <mx:columns>
      <mx:DataGridColumn minWidth="300" dataField="className"/>
      <mx:DataGridColumn minWidth="100" dataField="duration"/>
      </mx:columns>
      </mx:DataGrid>

      <mx:TextInput id="ST"/>
      <mx:TextInput id="FN"/>
      </mx:Application>

      Any help is greatly appreciated.

      Thanks,

      JB