panix/wgt-scroll-pager

Infinite AJAX scrolling

Installs: 228

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Language:JavaScript

Type:pixelion-component

2.0.1 2023-06-10 11:17 UTC

This package is auto-updated.

Last update: 2024-11-10 14:06:14 UTC


README

infinite scrolling page using AJAX.

Y2SP works with a yii\data\Pagination object which specifies the totally number of pages and the current page number.

Pager is build with help of jQuery Infinite Ajax Scroll plugin.

Latest Stable Version Total Downloads Monthly Downloads Daily Downloads Latest Unstable Version License

Requirements

  • Yii 2.0
  • PHP 5.4

Installation

The preferred way to install this extension is through Composer.

Either run

php composer require panix/wgt-scroll-pager "dev-master"

or add

"panix/wgt-scroll-pager": "dev-master"

to the require section of your composer.json file.

Usage

Just pass the ScrollPager class name to the ListView pager configuration. Make sure that items in your list have some classes that can be used as JavaScript selectors.

ListView

echo ListView::widget([
     'dataProvider' => $dataProvider,
     'itemOptions' => ['class' => 'item'],
     'itemView' => '_item_view',
     'pager' => ['class' => \panix\wgt\scrollpager\ScrollPager::className()]
]);

GridView

echo GridView::widget([
     'dataProvider' => $dataProvider,
     'pager' => [
        'class' => \panix\wgt\scrollpager\ScrollPager::class,
        'container' => '.grid-view tbody',
        'item' => 'tr',
        'paginationSelector' => '.grid-view .pagination',
        'triggerTemplate' => '<tr class="ias-trigger"><td colspan="100%" style="text-align: center"><a style="cursor: pointer">{text}</a></td></tr>',
     ],
]);

Configuration

General Options

Extensions

Extension Options

Plugin Events

Report

License

wgt-scroll-pager is released under the MIT License. See the bundled LICENSE.md for details.

Resources