2 Replies Latest reply on Oct 12, 2010 5:35 AM by PaddyMc2010

    DataGrid Sorting Issues


      Dear Good Sirs,


      I have encountered a problem with an app of mine where i have a datagrid that i refresh every 30 seconds.  However on the refresh of the dataset i will loose the sorting that i have on my datagrid.  I have trailed the net for various work arounds but so far have been unsuccessful and would appreciate some advice as to how i might be able to get around this issue.  I take the data from a source url to provide and xml list.  Sample below.



      //where the data is coming from

      mx:HTTPService id="httpGetOffers" url="testURL" method="GET"

      resultFormat="e4x" result="doxmltestlist(event)" fault="fault(event)" useProxy="false" />



      //my xmllist

      [Bindable] private var xmltestlist:XMLList;


      /result set

      private function doxmltestlist(evt:ResultEvent):void


      xmltestlist = evt.result.r;




      //my grid

      <mx:Panel title="Offer Bonds Only">

      <renders:CitiDataGrid id="dgtestsort" dataProvider="{xmltestlist}" rowCount="20" variableRowHeight="true"totalRowColor="0xCCCCCC" >


      <mx:DataGridColumn dataField="1" headerText="test1 sortCompareFunction="{numericSortByField('x')}"/>

      <mx:DataGridColumn dataField="2" headerText="test2" sortCompareFunction="{numericSortByField('autonegtotaloffers')}"/>

      <mx:DataGridColumn dataField="3" headerText="test3"  sortCompareFunction="{numericSortByField('done')}"/>




      Thanks in advance for your assistance.