Jump to:

22972 Posts in 11596 Topics by 2824 members

General Questions

SilverStripe Forums » General Questions » Return paginated results that respond to Ajax requests

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

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

Page: 1
Go to End
Author Topic: 833 Views
  • tv
    Avatar
    Community Member
    43 Posts

    Return paginated results that respond to Ajax requests Link to this post

    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.

  • zenmonkey
    Avatar
    Community Member
    524 Posts

    Re: Return paginated results that respond to Ajax requests Link to this post

    Take a look at the AJAX basics page

    http://doc.silverstripe.org/old/recipes:ajax_basics

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

    833 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.