I'm using scroll pager for my web ; and I'm using pjax for my form
after I submit my form and reload my yii2 scroll pager it not working if I click on : load more items.
when my content is submited and the listview is reloaded the Load more items not working
the is my code for my list view :
<?php Pjax::begin(['id' => 'post-list']) ?> <?= ListView::widget([ 'dataProvider' => $dataProvider, 'summary'=>'', 'itemOptions' => ['class' => 'item'], // LY - FOR ( LOAD MORE ) 'itemView' => '/content/views/chnPosts', 'pager' => ['class' => ScrollPager::className(), 'enabledExtensions' => [ ScrollPager::EXTENSION_TRIGGER, ScrollPager::EXTENSION_SPINNER, ScrollPager::EXTENSION_NONE_LEFT, ScrollPager::EXTENSION_PAGING, ], ] ]); ?> <?php Pjax::end() ?>
I'm using scroll pager for my web ; and I'm using pjax for my form after I submit my form and reload my yii2 scroll pager it not working if I click on : load more items. when my content is submited and the listview is reloaded the Load more items not working
the is my code for my list view :
<?php Pjax::begin(['id' => 'post-list']) ?> <?= ListView::widget([ 'dataProvider' => $dataProvider, 'summary'=>'', 'itemOptions' => ['class' => 'item'], // LY - FOR ( LOAD MORE ) 'itemView' => '/content/views/chnPosts', 'pager' => ['class' => ScrollPager::className(), 'enabledExtensions' => [ ScrollPager::EXTENSION_TRIGGER, ScrollPager::EXTENSION_SPINNER, ScrollPager::EXTENSION_NONE_LEFT, ScrollPager::EXTENSION_PAGING, ], ] ]); ?> <?php Pjax::end() ?>
and my form is : `
$(document).ready(function (e) { $('#pjax-glr').on('pjax:success', function() { console.log('yes'); $("#postgallery-post_text").val(''); $.pjax.reload("#post-list", {timeout : false}); init(); }); });