2017 © Pedro Peláez
 

yii2-extension yii2-infinite-scroll

Link pager with infinite scroll support.

image

darkcs/yii2-infinite-scroll

Link pager with infinite scroll support.

  • Tuesday, September 8, 2015
  • by DarkCs
  • Repository
  • 2 Watchers
  • 14 Stars
  • 1,342 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 11 Forks
  • 2 Open issues
  • 1 Versions
  • 8 % Grown

The README.md

Yii2 Infinite Scroll

LinkPager with infinite scroll support, (*1)

Installation

php composer.phar require --prefer-dist "darkcs/yii2-infinite-scroll" "*"

Options

$autoStart true;
$containerSelector .list-view;
$itemSelector .item;
$paginationSelector .pagination;
$nextSelector .pagination .next a:first;
$bufferPx 40;
$pjaxContainer null;

Usage example

$pjax = \yii\widgets\Pjax::begin();

echo \yii\widgets\ListView::widget([
    'dataProvider' => $dataProvider,
    'options' => [
        'class' => '.list-view',
    ],
    'itemView' => '_item',
    'summary' => false,
    'layout' => '{items}

{pager}
', 'pager' => [ 'class' => \darkcs\infinitescroll\InfiniteScrollPager::className(), 'paginationSelector' => '.pagination-wrap', 'pjaxContainer' => $pjax->id, ], ]); \yii\widgets\Pjax::end();

JS usage

// init
$('.list-view').infinitescroll();
// enable, paused by default
$('.list-view').infinitescroll('start');
// disable
$('.list-view').infinitescroll('stop');

Events

$('.list-view').on('infinitescroll:afterRetrieve', function(){
    console.log('infinitescroll:afterRetrieve');
});

$('.list-view').on('infinitescroll:afterStart', function(){
    console.log('infinitescroll:afterStart');
});

$('.list-view').on('infinitescroll:afterStop', function(){
    console.log('infinitescroll:afterStop');
});

The Versions

08/09 2015

dev-master

9999999-dev

Link pager with infinite scroll support.

  Sources   Download

MIT

The Requires

 

by Yuri Plaksunov

extension yii2 pager scroll infinite endless autopagerize