yii2-grid
yii2-grid copied to clipboard
Feature request or doc to save others some time - easy infinite scroll instead of pager
Not sure if you are aware how easy infinite scroll can replace paging in your grid view widget:
'pager' => [
'class' => \kop\y2sp\ScrollPager::className(),
'container' => '.grid-view',
'item' => '.kv-grid-table tbody tr',
'triggerOffset' => 1000,
],
works easy to add infinite scroll. After investigating various extensions and plugins, tried this one and worked first go (so far anyway - with only one minor display anomaly on spinner after filtering).
Potentially could add option to gridview perhaps - or just a note or demo in docs might help others.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Thanks for the suggestion. Will look at it when I get time.
Don’t rush, there are a couple of minor issues when used with pjax that I will look into in next few days - i think there are events in the plugin that will fix these but I will found out and put explanation and solution back in this issue.
On 30/09/2015, at 1:25 am, Kartik Visweswaran [email protected] wrote:
Thanks for the suggestion. Will look at it when I get time.
— Reply to this email directly or view it on GitHub.
yes as mentioned will need to evaluate once I get time for this... its currently not on my priority list
Understood, and thanks for so many great extensions. They are a massive asset to the framework.
FYI when you get time:
My final personal configuration:
'pager' => [
'class' => ScrollPager::className(),
'container' => '.grid-view',
'item' => '.kv-grid-table tbody tr',
'enabledExtensions' => [
ScrollPager::EXTENSION_SPINNER,
],
],
There also appears to be a minor easily by-passable bug when used with pjax at this time though could be fixed by the time you get this - my simple solution for now, and suggested plugin fix is at https://github.com/webcreate/infinite-ajax-scroll/issues/219
Hi,
Unfortunately, I got this error in terms of bs4:
Setting unknown property: kop\y2sp\ScrollPager::linkContainerOptions
Is it possible to make it work ?
Thanks a lot!
For the record, I used different selectors (still on bs3)
'pager' => [
'class' => ScrollPager::class,
'container' => '.kv-grid-table tbody',
'item' => 'tr',
'enabledExtensions' => [
ScrollPager::EXTENSION_SPINNER,
],
],