2017 © Pedro Peláez
 

yii2-extension yii2-infinite-scroll

Link pager with infinite scroll support.

image

apexwire/yii2-infinite-scroll

Link pager with infinite scroll support.

  • Monday, April 4, 2016
  • by ApexWire
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2,505 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 11 Forks
  • 0 Open issues
  • 1 Versions
  • 4 % Grown

The README.md

Yii2 Infinite Scroll

LinkPager with infinite scroll support, (*1)

Installation

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

Options

$autoStart true; -
$containerSelector .list-view;
$itemSelector .item;
$paginationSelector .pagination;
$nextSelector .pagination .next a:first;
$bufferPx 40;
$pjaxContainer null;
$alwaysHidePagination = true;
$container = ['window']; window - loading content on main scrollbar approaching document bottom, container - loading content on container scrollbar approaching container bottom,

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' => \apexwire\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

04/04 2016

dev-master

9999999-dev

Link pager with infinite scroll support.

  Sources   Download

MIT

The Requires

 

by Avatar ApexWire
by Yuri Plaksunov

extension yii2 pager scroll infinite endless autopagerize