2017 © Pedro Peláez
 

yii2-extension yii2-infinite-scroll

Link pager with infinite scroll support.

image

2fox/yii2-infinite-scroll

Link pager with infinite scroll support.

  • Friday, September 29, 2017
  • by 2fox
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 11 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Yii2 Infinite Scroll

LinkPager with infinite scroll support, (*1)

Installation

php composer.phar require --prefer-dist "2fox/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' => \twofox\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

29/09 2017

dev-master

9999999-dev

Link pager with infinite scroll support.

  Sources   Download

MIT

The Requires

 

by Dmytro Gural

extension yii2 pager scroll infinite endless autopagerize