Jump to:

10994 Posts in 2728 Topics by 1819 members

All other Modules

SilverStripe Forums » All other Modules » Easy AJAX pagination for SilverStripe with silverstripe-frontend v0.2

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 459 Views
  • MateuszU
    Avatar
    Community Member
    89 Posts

    Easy AJAX pagination for SilverStripe with silverstripe-frontend v0.2 Link to this post

    Hi,

    I thought I'd share info on the 0.2 release of https://github.com/mateusz/silverstripe-frontend (mateusz/frontend on packagist).

    This module allows for easy addition of AJAX pagination on top of your typical SilverStripe templates that consume a DataList. It provides two jQuery widgets: one for regular pagination, and endless stream with a "More" button at the end.

    Comes with a choice of dummy mode (quick start) or more advanced PJAX mode (faster, but more work), HTML5 history support, underscore templating, easy hook-up of progress indicators, event triggers for custom behaviours when transiting between states, and as many as two (whoa!) how-tos

    Here is a very short walkthrough:

    PHP:

    return new AjaxPaginatedList(Page::get(), $this->request);

    Template:

    <div class='pagination-content'></div>
    <div class='pagination" $Pages.PaginationMetadata(2)>
    ... usual SS pagination goes here ...
    </div>

    Javascript:

    $('div.pagination').sspagination({contentSelector: '.pagination-content'});
    // Or for endless:
    $('div.pagination').ssendless({contentSelector: '.pagination-content'});

    I hope someone can find it useful Let me know if you find any problems or if you have any feature requests.

    m

  • martimiz
    Avatar
    Forum Moderator
    1086 Posts

    Re: Easy AJAX pagination for SilverStripe with silverstripe-frontend v0.2 Link to this post

    Sounds nice, thanks for sharing! I'm definitely going to give it a try

    Martine

    459 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.