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

How disable changing address? #89

Open luckyalexandr opened 6 years ago

luckyalexandr commented 6 years ago

First thanks for this extension. Easy and beautiful. But i can't find how deny they add page\per-page parameters to the link in address bar. My code with Pjax: <?php Pjax::begin([ 'id' => 'productList', 'enablePushState' => false, 'enableReplaceState' => false, ]); ?> <?= ListView::widget([ 'dataProvider' => $dataProvider, 'itemView' => '_view', 'itemOptions' => ['class' => 'item'], 'layout' => "{items}\n{pager}", 'pager' => [ 'class' => \kop\y2sp\ScrollPager::className(), 'triggerTemplate' => '<div class="clearfix"></div></div> <div class="ias-trigger" style="text-align: center; cursor: pointer; padding-bottom: 2em;"><a>{text}</a></div>', 'noneLeftText' => 'You reached the end', 'noneLeftTemplate' => '<div class="clearfix"></div><p style="text-align: center;>{text}</p>', 'negativeMargin' => 100, ] ]); ?> <?php Pjax::end(); ?>

How it fix?

kimhongn89 commented 6 years ago

I need to disable it too. Do we have any setting for this options

kimhongn89 commented 6 years ago

Hi luckyalexandr, I had find solution for this issue. Just disable ScrollPager::EXTENSION_HISTORY 'pager' => [ 'class' => \kop\y2sp\ScrollPager::className(), 'enabledExtensions' => [ ScrollPager::EXTENSION_TRIGGER, ScrollPager::EXTENSION_SPINNER, ScrollPager::EXTENSION_NONE_LEFT, ScrollPager::EXTENSION_PAGING, //ScrollPager::EXTENSION_HISTORY ] ]

Hope this is helpful.