CodeIgniter Forums
twitter like pagination - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: twitter like pagination (/showthread.php?tid=53694)



twitter like pagination - El Forum - 08-04-2012

[eluser]osama[/eluser]
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:-)





twitter like pagination - El Forum - 08-04-2012

[eluser]skunkbad[/eluser]
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.


twitter like pagination - El Forum - 08-04-2012

[eluser]osama[/eluser]
[quote author="skunkbad" date="1344096167"]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.[/quote]

I'll try but if you show me an Example It will be Great work .
thanks, :-)