2 Replies Latest reply on Jan 31, 2011 8:13 AM by davidd3141525

    Sorting and Paging Large Databases




      I enabled paging on a large database.  The datagrid initially populates and displays quickly and if I scroll down one or two pages it updates quick.  If I scroll halfway through the entire database the grid updates very slowly; about as slow as if I had loaded in half the database.  Is the paged PHP function called for each page I scrolled past?  What are some methods to work around this?


      I also ran into a problem when attempting to sort by a column.  It seems like the entire database is loaded for this too, which makes sense.  Is there an event which fies  when a datagrid column is clicked on so I can make a new PHP call instead of waiting for the entire database to be loaded?


      If there is a way to use paging until the entire database loads in the background and then switch to the loaded data afterwards, that might be a decent solution for me.


      I originally posted this in the Flash Builder forum but just deleted and moved here because I think Flex is more appropriate.  Please let me know if this is not the case.





        • 1. Re: Sorting and Paging Large Databases
          Flex harUI Adobe Employee

          If you are dragging the thumb in the scrollbar, it shouldn't load all the

          pages in-between if you move fast enough.


          There is a HEADER_RELEASE event that can be used to block or customize

          sorting.  There should be past threads or blog posts on how to do

          server-side sorting.


          By default, we don't unload pages so once the entire DB is paged in, you

          will be using the local data.

          • 2. Re: Sorting and Paging Large Databases
            davidd3141525 Level 1

            I'm scrolling as quickly as I can and the load switches from about 2-3 seconds to nearly a minute.  Afterwards, loading returns to normal if I move back up the datagrid or one page forward.  Trying to jump to the bottom has the same effect as jumping to the middle.