Class GridLazyDataView<T>
- java.lang.Object
-
- com.vaadin.flow.data.provider.AbstractDataView<T>
-
- com.vaadin.flow.data.provider.AbstractLazyDataView<T>
-
- com.vaadin.flow.component.grid.dataview.GridLazyDataView<T>
-
- Type Parameters:
T
- the type of the items in grid
- All Implemented Interfaces:
com.vaadin.flow.data.provider.DataView<T>
,com.vaadin.flow.data.provider.LazyDataView<T>
,Serializable
public class GridLazyDataView<T> extends com.vaadin.flow.data.provider.AbstractLazyDataView<T>
Data view implementation for Grid with lazy data fetching. Provides information on the data and allows operations on it.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description GridLazyDataView(com.vaadin.flow.data.provider.DataCommunicator<T> dataCommunicator, Grid<T> component)
Creates a new lazy data view for grid and verifies the passed data provider is compatible with this data view implementation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
setItemCountCallback(com.vaadin.flow.data.provider.CallbackDataProvider.CountCallback<T,Void> callback)
Sets a callback that the Grid uses to get the exact item count in the backend.void
setItemCountEstimate(int itemCountEstimate)
void
setItemCountFromDataProvider()
void
setItemCountUnknown()
-
Methods inherited from class com.vaadin.flow.data.provider.AbstractLazyDataView
getDataCommunicator, getItem, getItemCountEstimate, getItemCountEstimateIncrease, getItems, getSupportedDataProviderType, setItemCountEstimateIncrease
-
Methods inherited from class com.vaadin.flow.data.provider.AbstractDataView
addIdentifierProviderChangeListener, addItemCountChangeListener, equals, getIdentifierProvider, refreshAll, refreshItem, setIdentifierProvider, verifyDataProviderType
-
-
-
-
Constructor Detail
-
GridLazyDataView
public GridLazyDataView(com.vaadin.flow.data.provider.DataCommunicator<T> dataCommunicator, Grid<T> component)
Creates a new lazy data view for grid and verifies the passed data provider is compatible with this data view implementation.- Parameters:
dataCommunicator
- the data communicator of the componentcomponent
- the grid
-
-
Method Detail
-
setItemCountCallback
public void setItemCountCallback(com.vaadin.flow.data.provider.CallbackDataProvider.CountCallback<T,Void> callback)
Sets a callback that the Grid uses to get the exact item count in the backend. Use this when it is cheap to get the exact item count and it is desired that the user sees the "full scrollbar size".The given callback will be queried for the count instead of the data provider
DataProvider.size(Query)
method when the component has a distinct data provider set withHasLazyDataView.setItems(BackEndDataProvider)
.- Parameters:
callback
- the callback to use for determining item count in the backend, notnull
- See Also:
setItemCountFromDataProvider()
,setItemCountUnknown()
-
setItemCountFromDataProvider
public void setItemCountFromDataProvider()
Calling this method will clear any previously set count callback with the
setItemCountCallback(CallbackDataProvider.CountCallback)
method.
-
setItemCountEstimate
public void setItemCountEstimate(int itemCountEstimate)
Calling this method will clear any previously set count callback
setItemCountCallback(CallbackDataProvider.CountCallback)
.
-
setItemCountUnknown
public void setItemCountUnknown()
Calling this method will clear any previously set count callback
setItemCountCallback(CallbackDataProvider.CountCallback)
.
-
-