Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Return paginated results that respond to Ajax requests

Go to End

2 Posts   1455 Views


Community Member, 44 Posts

29 September 2011 at 9:32am

I am using the silverstripe pagination recipe to return a result set of paginated items and have the pagination working fine.

I would like to try and create an endless pagination using Ajax that when the viewer reaches the bottom of the page the next DO resultset is appended to the current set so that the user doesn't have to hit a next button, but the full list of items will load as the user scrolls down the page.

So, rather than hitting next and having the whole page refresh to http://localhost:8888/products?start=15, products 15-30 will load with Ajax at the bottom of the current page.

I have the jquery down that triggers the Ajax call when the user reaches the bottom of the page. I just need to know how to make the silverstripe side work.

Thanks alot.


Community Member, 545 Posts

30 September 2011 at 4:07am

Take a look at the AJAX basics page

You'l need to crate a new template (ajaxSnippet) for your results page