-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature] Pagination widget with lazy loading #55
Comments
So you mean something like this? class LazyPagination<T> {
...
public int getMaxPage() {
return supplier.get();
}
public Collection<T> getWidgetsFor(int page) { ... }
public KelpItem getItem(T type) { ... }
} The idea of a lazy loading pagination is really good, you are right that loading all pages for a simple update is overkill. But what does the class type stand for in this case? Is it a widget type? Because then you couldn't render different database entries as different widget types anymore. |
Yes i meant something like this. In my example the class type stands for the object obtained from the database. |
Is your feature request related to a problem? Please describe.
Currently to use the pagination with a database you need to load all entries and map them to a kelp item.
Describe the solution you'd like
A lazy Pagination class which has a type argument and needs an supplier and two functions.
The supplier returns the max page and the first function takes an int as the page and returns an array or list of the type. The second function takes an object of the type and returns a kelp item.
The text was updated successfully, but these errors were encountered: