yii2-grid icon indicating copy to clipboard operation
yii2-grid copied to clipboard

Feature request or doc to save others some time - easy infinite scroll instead of pager

Open andrewblake1 opened this issue 9 years ago • 7 comments

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.

andrewblake1 avatar Sep 27 '15 08:09 andrewblake1

Thanks for the suggestion. Will look at it when I get time.

kartik-v avatar Sep 29 '15 12:09 kartik-v

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.

andrewblake1 avatar Sep 29 '15 18:09 andrewblake1

yes as mentioned will need to evaluate once I get time for this... its currently not on my priority list

kartik-v avatar Sep 29 '15 18:09 kartik-v

Understood, and thanks for so many great extensions. They are a massive asset to the framework.

andrewblake1 avatar Sep 29 '15 18:09 andrewblake1

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

andrewblake1 avatar Oct 03 '15 22:10 andrewblake1

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!

strtob avatar May 15 '21 09:05 strtob

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,
        ],
    ],

maxxer avatar Oct 21 '22 12:10 maxxer