vitmalina / w2ui

UI widgets for modern apps. Data table, forms, toolbars, sidebar, tabs, tooltips, popups. All under 120kb (gzipped).
http://w2ui.com
MIT License
2.64k stars 730 forks source link

How to do infinity scroll load more records programmatic ? #2446

Closed neoedmund closed 11 months ago

neoedmund commented 11 months ago

Describe the problem your feature will solve. Showing images according to the records loaded in the grid below the grid. scroll to the end of the images, need to load more records programmatic.

Describe the solution you'd like a method like grid.loadMore(100)

Describe alternatives you've considered Idk

Additional context Thanks.

alexkuznetsov commented 11 months ago

@neoedmund

Have you tried https://w2ui.com/web/docs/2.0/w2grid.skip ?

This may help you with your task.

neoedmund commented 11 months ago

Thank you , I wil try it later.

neoedmund commented 11 months ago

skip() will remove previous loaded records, how can I keep them?

alexkuznetsov commented 11 months ago

@neoedmund well, you can cache them before the action.

you can combine theese steps for achive desired result:

alexkuznetsov commented 11 months ago

@neoedmund

Before all, just try scroll the view to the last row using https://w2ui.com/web/docs/2.0/w2grid.scrollIntoView I'm not checked it, but, in my opiniton, this sholuld trigger loading records and loaded records should be appended to the current rows