12 Replies Latest reply on Jan 27, 2010 7:01 PM by Flexicious-12vHYo


      Has anyone addressed pagination through Flex yet? I've searched the forums but have only seen a few questions with no replies. I need to implement this on a datagrid.
        • 1. Re: Pagination
          ntsiii Level 3
          What do you mean, specifically, by "pagination"?
          • 2. Pagination
            phi2265 Level 1
            Pagination is creating pages / placing objects or ads on a page, ie. for a newspaper

            I've been thinking about making an app to do this.. but its just a thought in the back of my mind at this point.... my plate is full right now. haha.

            What are you trying to accomplish exactly?

            • 3. Re: Pagination
              blastbeat Level 1
              No, what I mean is returning a list of 30000 results, and only displaying 50 at a time with next / previous links over a datagrid.
              • 4. Re: Pagination
                phi2265 Level 1
                Ahh.. thats not what we mean by pagination in the newspaper industry. I see why Tracy asked. My fault...

                That doesn't sound like it should be too difficult.. have you tried it? I mean if it works with 100 results, it'll work with 30000.
                • 5. Re: Pagination
                  blastbeat Level 1
                  Phi, not sure where you got the assumption it works with 100? Let me be clear. I have a datagrid with 3000 results. That's too much to show the user at once. Commonly paging of records is how people deal with such large data sets. It's basic in CF/ASP, but I've yet to see an example of this done in FLEX.
                  • 6. Re: Pagination
                    phi2265 Level 1
                    Yeah I don't know how to do it in the other languages.. but I might be able to help you with Flex.. Give me some more info.

                    And I wasn't assuming it worked with 100.. just saying..

                    What kind of variable are the results stored in? I'll tell you what I'm thinking but I need to know the variable type.

                    • 7. Re: Pagination
                      Josh Johnson
                      Just out of curiosity, why paginate the results? Normally, the reason for paginating the results is that you don't want to take the server hit of downloading the full set of results in the first place, so you instead do fetches to the server in paged chunks. If you're planning to break up the results client-side, it sort of defeats that purpose.

                      Plus, if you have all the results client-side to begin with, you can do some nifty things like sorting and filtering across the entire data set. Just a thought.
                      • 8. Re: Pagination
                        ntsiii Level 3
                        The flash player, while 8+ is massively better that 7- is still bottlenecked by rendering visual data. Your data service will return 3000 records in milliseconds, but if you try to render them all, the player will be very slow.

                        Actually, the list-based components are pretty good at minimizing rendering, by only rendering the visible set of data.

                        I do not have any definitive solution, but do a test with a DataGrid that is restircted to some reasonable rowCount, like 10-15, and see how it performs.

                        Matt Chotin blogged in detail about using large datasets with server-side paging, back in the 1.5 days. This might not be necessary with 3000 records though.

                        Al i can suggest is to test a bit.

                        • 9. Re: Pagination
                          ntsiii Level 3
                          If we are talking 30,000 rows, then server-side paging might be the ticket. Do find Matt's articles. the concepts will be valid in 2.x
                          • 10. Re: Pagination
                            phi2265 Level 1
                            What I was thinking is to store all of the results to 1 variable then split that to different variables based on how many you want to show at once.

                            • 11. Re: Pagination
                              ntsiii Level 3
                              Sure, that is quite valid. Perhaps store it in an array, and when the user pages, use Array.slice to get the range of items. Put that into an ArrayCollection, for binding consumption by the list-based component.

                              Lits of variables here, I advise some early proof of concept testing.

                              • 12. Re: Pagination

                                Please feel free to check out http://www.flexicious.com. This is an extension to the Flex DataGrid/Advanced DataGrid components that provide pagination, filter, footer, Select All, support out of the box, in addition to a host of other features.