1 Reply Latest reply on Jul 14, 2010 12:39 PM by UbuntuPenguin

    Help Needed -- Issue with Lazy Loading using AdvancedDataGrid

    AFDB Level 1

      Hi,

                                                                    ****Posting second time to get the attention *****

      We are new to Flex.

       

      We are trying to implement Lazy Loading of data fetched from backend. In order to prevent over loading of server, we would like to fetch only a certain portion of data at a time. Once the user scrolls to the end of the current list ( or 3/4th of the current list) we would like to initiate a request to get next set of data. And we would like to allow sorting or filtering of the data which is already fetched on the client side.

       

      We tried exploiting ItemPendingError feature using IList as the ADG.dataProvider. The lazy loading works fine if the user does not sort or filter until all the data is fetched. But it stops working if user sorts or filters the data before complete data is fetched,

       

      We created a class called LazyList that extends Event Dispatcher and implements IList:

      ===================================================

      public

       

       

      class LazyList extends EventDispatcher implements IList

      ......

      }

      ====================================================

      When the user tries sorting/filtering "toArray()" method gets called. If we return the current array, the sorting/filtering works but Lazy Loading stops working from that point. But if we return null, sorting/filtering does not work but Lazy Loading works just fine.

       

      We are getting the data from backend using HTTPService. The backend service can return at most 500 rows at a time.

       

      Any example implementations or suggestions are most welcome. We are planning to add this feature as part of common component. Any quick help is much appreciated.