-
Notifications
You must be signed in to change notification settings - Fork 1
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
Enhanced Selection doesn't work with GridLazyDataView #109
Comments
As mentioned in #110 (comment), the current implementation iof this feature is intentionally restricted to in-memory data providers, because there is no efficient way to compute |
I have the following use case. I can host in memory all of the items, so I can use my grid without lazy loading, but the performance is slow, because every time that I enter in the grid I have to load all the items in memory. In certain cases (very few, rare I would say) I would need to select all the items to do a bulk operation (and my idea is to use enhanced selection for that), and in that time I don't mind in waiting to load all the items in memory. So if I understand well, is this feature only going to fetch all the items when I select a "big range" of the grid and in the rest of the cases just let the lazy loading mechanism to work as always? |
If you are asking about the proposal in PR #110, it was rejected because selecting M items from a Grid with N items would be O(N), regardless of the size of that range, and selecting M items one at a time would be O(M*N), while an optimum solution would be O(M) in both cases. In comparison, selection-grid is O(M) and O(M^2) respectively. Our limitation is that we designed the feature assuming that retrieving the index of an item is a cheap operation, which holds true for in-memory datasets. |
when using Enhanced Selection with Lazy Data Provider, this exception is thrown.
java.lang.IllegalStateException: GridListDataView only supports 'ListDataProvider' or it's subclasses, but was given a 'AbstractBackEndDataProvider'. Use either 'getLazyDataView()', 'getListDataView()' or 'getGenericDataView()' according to the used data type. at com.vaadin.flow.data.provider.AbstractDataView.verifyDataProviderType(AbstractDataView.java:114) at com.vaadin.flow.data.provider.AbstractDataView.<init>(AbstractDataView.java:74)
The text was updated successfully, but these errors were encountered: