kop / yii2-scroll-pager

Infinite AJAX scrolling for Yii2 ListView widget
https://kop.github.io/yii2-scroll-pager/
MIT License
180 stars 63 forks source link

Cant make it work #9

Closed alexweb-zz closed 10 years ago

alexweb-zz commented 10 years ago

1) Inserted widget this way:

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

At the end of the page appears "Load more items". But it doesnt load more items automatically when I scroll. Loads more items only when I click that link.

alexweb-zz commented 10 years ago

It started work when I set 'triggerOffset' to big value:

'triggerOffset' => 1000, 

Not sure if it's correct. If I set 'triggerOffset' => 2, it loads 1 more page automatically and then stops, if I set 'triggerOffset' => 3, It loads 3 pages and then stops, etc. So I think the problem is incorrect work with default 'triggerOffset' => 0,

kop commented 10 years ago

Hi. Thank you for your report and sorry for long response. This is not an issue, but expected work of the jQuery IAS extension. Please take a look on corresponding documentation.

Having unlimited number of the auto loaded pages are generally a bad idea for UI, that's why plugin expects some point to stop.