EllisLab text mark
Advanced Search
     
twitter like pagination
Posted: 04 August 2012 09:36 AM   [ Ignore ]
Joined: 2012-08-02
7 posts

Hi friends ,
I’m New to CI . I’d like to know how to make a twitter like pagination in codeigniter,
That’s an example for what i want
http://demos.9lessons.info/loadmore.php
any help
I’ll be Grateful:-)

 

 
Posted: 04 August 2012 12:02 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2009-05-17
1415 posts

This would be extremely simple to pull off, but it is not really pagination. On initial pageload, you would count all records in the database, and show the data for the first 10 records. If the count is higher than 10, you show the more button. When the more button is clicked, use JS to count what you have now, then do an ajax request for the next ten records, starting with the count +1. Pass the current number along with the ajax request so that you have an offset for your query. When you have reached the count from the initial pageload, disable or hide the more button.

 Signature 

Brian
Brian’s Web Design - Temecula
Community Auth - CodeIgniter Authentication Application

 
Posted: 04 August 2012 05:37 PM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Joined: 2012-08-02
7 posts
skunkbad - 04 August 2012 12:02 PM

This would be extremely simple to pull off, but it is not really pagination. On initial pageload, you would count all records in the database, and show the data for the first 10 records. If the count is higher than 10, you show the more button. When the more button is clicked, use JS to count what you have now, then do an ajax request for the next ten records, starting with the count +1. Pass the current number along with the ajax request so that you have an offset for your query. When you have reached the count from the initial pageload, disable or hide the more button.

I’ll try but if you show me an Example It will be Great work .
thanks, grin