Thursday, April 28, 2011

How can we implement Paging using json, Need the records to be preloaded. Help

I am trying to implement paging in PHP, using Json. I need the data to be preloaded, before the user click next results. Please Give me some suggestions or some references.

From stackoverflow
  • jquery has a plugin you can use for pagination, the results have to be preloaded for this as far as i know. We are using this in an app currently, but it wasn't implemented by me...

    http://plugins.jquery.com/project/pagination

  • First off, JSON is for data communication not for data presentation. You need to store the JSON data in a persistent place, either a session variable or in Javascript variables. If you use the PHP session you'd use the PHP code to step through the data, if Javascript I'd go with JQuery. Just store the current starting point in the data in a persistent variable as well and use that as the place to start reading the data each time you display a new page.

    hofo : If you do a Google search for "json php paging" you'll find several tutorials on how to accomplish this: http://www.google.com/search?q=json+php+paging
    Matt Ball : JSON is "for" data representation, not communication (I guess you might have meant "communication" differently, though).

0 comments:

Post a Comment