SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2006
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Pagination with response stream

    Hi,
    Is it possible to do pagination from the response stream data?

    Thanks!

  2. #2
    SitePoint Evangelist
    Join Date
    Feb 2006
    Location
    Worcs. UK
    Posts
    404
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My first thought was that if you could get the data into the same format as that returned from a database query (from memory, I think that is an array of hashes, with each hash representing a row of data; the hash keys matching the field names) then the answer would be yes.

    However, I think the paginator works by modifying the SQL calls to pull only the rows for the current page. That is you don't pull all the data into the array and then paginate the array. Instead the SQL call is modified so that only a page worth of data is pulled from the database and used to populate the data array.

    Therefore, I think your best bet is to dig into the Rails code and work through the pagination methods to see how they work, and build you own version based on them.

  3. #3
    SitePoint Enthusiast
    Join Date
    Feb 2006
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am getting the data from response stream as a comma separated values not as hashes. I couldn't find the way to paginate with the data stream so i am temporary storing the data in the table just for the pagination. It's not the good way to do it..but couldn't find the better way of doing this..

    Thank you for the response.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •