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

PJAX pushState fails #84

Closed omer-sds closed 7 years ago

omer-sds commented 7 years ago

i am using ListView widget with this plugin and i set enablePushState=false for Pjax and i have a thumbnail script nailthumb which generates the thumbnails for the listings ,I used php to make the javascript call statements and then load them on page load to generate the thumbnails, it works perfect with pjax but as soon as i start using the loadmore plugin the enablePushstate stops working and it starts appending querystring in the address bar, and the new records loaded after clicking load more do not have the thumbnails generated which means i have to manually trigger those javscript calls after the loading of the records.

Is there any way i can call a script after clicking the loadmore button, and what should be done to avoid the query string in the address bar because if i click on load more and then scroll down to the last record the querystring appended in the address bar is ?page=2&per-page=8 and if i keep the scroll on same position and refresh the page it keeps showing the last page records because the address bar has the above querystring appended and there is no back button or go back to move back to the first page. Any solutions