PHPackages                             badaboom/yii2-scroll-pager - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. badaboom/yii2-scroll-pager

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

badaboom/yii2-scroll-pager
==========================

Infinite AJAX scrolling for Yii2 ListView widget

2.5.1(7y ago)028MITPHPPHP &gt;=7.0.0

Since Apr 4Pushed 7y ago1 watchersCompare

[ Source](https://github.com/IamFake/yii2-scroll-pager)[ Packagist](https://packagist.org/packages/badaboom/yii2-scroll-pager)[ Docs](http://kop.github.io/yii2-scroll-pager/)[ RSS](/packages/badaboom-yii2-scroll-pager/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (17)Used By (0)

Yii2 Scroll Pager
=================

[](#yii2-scroll-pager)

[Yii2 Scroll Pager (Y2SP)](http://kop.github.io/yii2-scroll-pager) turns your regular paginated page into an infinite scrolling page using AJAX.

Y2SP works with a `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](http://infiniteajaxscroll.com/).

[![Latest Stable Version](https://camo.githubusercontent.com/2ee8c652a926274b7930b5cd4280c406820b6325e4d453e3c0f29bf2060a8781/68747470733a2f2f706f7365722e707567782e6f72672f6b6f702f796969322d7363726f6c6c2d70616765722f762f737461626c652e737667)](https://packagist.org/packages/kop/yii2-scroll-pager)[![Code Climate](https://camo.githubusercontent.com/1d4cfc5ebff3ecdb814c87902dbad5b24092a4f093df299bc3bd7b8698356e5c/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6b6f702f796969322d7363726f6c6c2d70616765722e706e67)](https://codeclimate.com/github/kop/yii2-scroll-pager)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/8c138949b9e1d1b2b08c93ead839adb441563ab9685da27f19c130f75f231203/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6b6f702f796969322d7363726f6c6c2d70616765722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/kop/yii2-scroll-pager/?branch=master)[![Dependency Status](https://camo.githubusercontent.com/ed381c30f41c2a621fd63438ec7a5dad778a729e9e02a9108a815a080cc97ad4/68747470733a2f2f67656d6e617369756d2e636f6d2f6b6f702f796969322d7363726f6c6c2d70616765722e737667)](https://gemnasium.com/kop/yii2-scroll-pager)[![License](https://camo.githubusercontent.com/e68f0799f53a59b2f974296d505ccec9eb4d9936f7fdfeff4978714eb9b665e6/68747470733a2f2f706f7365722e707567782e6f72672f6b6f702f796969322d7363726f6c6c2d70616765722f6c6963656e73652e737667)](https://packagist.org/packages/kop/yii2-scroll-pager)

Requirements
------------

[](#requirements)

- Yii 2.0
- PHP 5.4

Installation
------------

[](#installation)

The preferred way to install this extension is through [Composer](http://getcomposer.org/).

Either run

`php composer.phar require kop/yii2-scroll-pager "dev-master"`

or add

` "kop/yii2-scroll-pager": "dev-master"`

to the `require` section of your `composer.json` file.

Usage
-----

[](#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

[](#listview)

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

### GridView

[](#gridview)

```
echo GridView::widget([
     'dataProvider' => $dataProvider,
     'pager' => [
        'class' => \badaboom\y2sp\ScrollPager::className(),
        'container' => '.grid-view tbody',
        'item' => 'tr',
        'paginationSelector' => '.grid-view .pagination',
        'triggerTemplate' => '{text}',
     ],
]);
```

Configuration
-------------

[](#configuration)

### General Options

[](#general-options)

Option nameDescriptionDefault valuecontainerThe selector of the element containing your items that you want to paginate.`.list-view`itemThe selector of the element that each item has.&lt;br Make sure the elements are inside the container element.`.item`paginationSelectorThe selector of the element containing the pagination.`.list-view .pagination`nextThe selector of the link element that links to the next page.
 The href attribute of this element will be used to get the items from the next page.
 Make sure there is only one(1) element that matches the selector.`.next a`delayMinimal number of milliseconds to stay in a loading state.`600`negativeMarginBy default IAS starts loading new items when you scroll to the latest `.item` element.
 The `negativeMargin` will be added to the items offset, giving you the ability to load new items earlier (please note that the margin is always transformed to a negative integer).

 *Example:* Setting a negativeMargin of 250 means that IAS will start loading 250 pixel before the last item has scrolled into view.`10`### Extensions

[](#extensions)

Option nameDescriptionDefault valueenabledExtensionsThe list of the enabled plugin extensions.\[
 `ScrollPager::EXTENSION_TRIGGER`,
 `ScrollPager::EXTENSION_SPINNER`,
 `ScrollPager::EXTENSION_NONE_LEFT`,
 `ScrollPager::EXTENSION_PAGING`,
 `ScrollPager::EXTENSION_HISTORY`
\]### Extension Options

[](#extension-options)

Option nameDescriptionDefault valuetriggerTextText of trigger the link.`Load more items`triggerTemplateAllows you to override the trigger html template.`{text}`triggerOffsetThe number of pages which should load automatically. After that the trigger is shown for every subsequent page.

 *Example:* if you set the offset to 2, the pages 2 and 3 (page 1 is always shown) would load automatically and for every subsequent page the user has to press the trigger to load it.`0`spinnerSrcThe src attribute of the spinner image.[![Spinner Image](https://raw.githubusercontent.com/kop/yii2-scroll-pager/v1.0.2/assets/infinite-ajax-scroll/images/loader.gif)](https://raw.githubusercontent.com/kop/yii2-scroll-pager/v1.0.2/assets/infinite-ajax-scroll/images/loader.gif)spinnerTemplateAllows you to override the spinner html template.``noneLeftTextText of the "nothing left" message.`You reached the end`noneLeftTemplateAllows you to override the "nothing left" message html template.`{text}`historyPrevThe selector of the link element that links to the previous page.
 The href attribute of this element will be used to get the items from the previous page.
 Make sure there is only one element that matches the selector.`.previous`overflowContainerA selector for `div` HTML element to use as an overflow container.`null`### Plugin Events

[](#plugin-events)

Option nameDescriptionDefault valueeventOnScrollTriggered when the visitors scrolls.`null`eventOnLoadTriggered when a new url will be loaded from the server.`null`eventOnLoadedTriggered after a new page was loaded from the server.`null`eventOnRenderTriggered before new items will be rendered.`null`eventOnRenderedTriggered after new items have rendered.`null`eventOnNoneLeftTriggered when there are no more pages left.`null`eventOnNextTriggered when the next page should be loaded.
 Happens before loading of the next page starts. With this event it is possible to cancel the loading of the next page.
 You can do this by returning false from your callback.`null`eventOnReadyTriggered when IAS and all the extensions have been initialized.`null`eventOnPageChangeTriggered when a used scroll to another page.`null`Report
------

[](#report)

- Report any issues [on the GitHub](https://github.com/kop/yii2-scroll-pager/issues).

License
-------

[](#license)

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

Resources
---------

[](#resources)

- [Project Page](http://kop.github.io/yii2-scroll-pager)
- [Packagist Package](https://packagist.org/packages/kop/yii2-scroll-pager)
- [Source Code](https://github.com/kop/yii2-scroll-pager)

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 87.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~101 days

Recently: every ~240 days

Total

16

Last Release

2893d ago

Major Versions

v1.0.2 → v2.1.12014-06-06

PHP version history (2 changes)v1.0.2PHP &gt;=5.4.0

2.5.1PHP &gt;=7.0.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/920aaefa588f2d827bd1247b2291f1fab2e5ac7c4751de1a78b1248dfa3b8f84?d=identicon)[badaboom](/maintainers/badaboom)

---

Top Contributors

[![kop](https://avatars.githubusercontent.com/u/645148?v=4)](https://github.com/kop "kop (87 commits)")[![IamFake](https://avatars.githubusercontent.com/u/196658?v=4)](https://github.com/IamFake "IamFake (5 commits)")[![karataserkan](https://avatars.githubusercontent.com/u/7448716?v=4)](https://github.com/karataserkan "karataserkan (1 commits)")[![lukascernydis](https://avatars.githubusercontent.com/u/3111717?v=4)](https://github.com/lukascernydis "lukascernydis (1 commits)")[![robregonm](https://avatars.githubusercontent.com/u/1051457?v=4)](https://github.com/robregonm "robregonm (1 commits)")[![slacki](https://avatars.githubusercontent.com/u/3284061?v=4)](https://github.com/slacki "slacki (1 commits)")[![bepehr](https://avatars.githubusercontent.com/u/3052297?v=4)](https://github.com/bepehr "bepehr (1 commits)")[![thyseus](https://avatars.githubusercontent.com/u/654271?v=4)](https://github.com/thyseus "thyseus (1 commits)")[![forecho](https://avatars.githubusercontent.com/u/1725326?v=4)](https://github.com/forecho "forecho (1 commits)")

---

Tags

pagerpaginationyii2yiiscrollscrolling

### Embed Badge

![Health badge](/badges/badaboom-yii2-scroll-pager/health.svg)

```
[![Health](https://phpackages.com/badges/badaboom-yii2-scroll-pager/health.svg)](https://phpackages.com/packages/badaboom-yii2-scroll-pager)
```

###  Alternatives

[kop/yii2-scroll-pager

Infinite AJAX scrolling for Yii2 ListView widget

180706.5k10](/packages/kop-yii2-scroll-pager)[brussens/yii2-maintenance-mode

Maintenance mode component for Yii framework 2.x.x version.

78256.3k5](/packages/brussens-yii2-maintenance-mode)[sjaakp/yii2-alphapager

Page data on initial character in Yii2.

184.4k](/packages/sjaakp-yii2-alphapager)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
