T
- data typepublic interface LazyDataView<T> extends DataView<T>
Modifier and Type | Method and Description |
---|---|
int |
getItemCountEstimate()
Gets the item count estimate.
|
int |
getItemCountEstimateIncrease()
Gets the item count estimate increase - how much the item count estimate
is increased once the previous item count estimate has been reached.
|
void |
setItemCountEstimate(int itemCountEstimate)
Sets the estimated item count for the component.
|
void |
setItemCountEstimateIncrease(int itemCountEstimateIncrease)
Sets how much the item count estimate is increased once the previous item
count estimate has been reached.
|
void |
setItemCountFromDataProvider()
Switches the component to get the exact item count from the data
provider's
DataProvider.size(Query) . |
void |
setItemCountUnknown()
Switches the component to automatically extend the number of items as the
previous end is almost reached.
|
addItemCountChangeListener, getItem, getItems, refreshAll, refreshItem, setIdentifierProvider
void setItemCountFromDataProvider()
DataProvider.size(Query)
. Use this when it is cheap to
get the exact item count and it is desired that the user sees the "full
scrollbar size".void setItemCountEstimate(int itemCountEstimate)
The given estimate is discarded if it is less than the currently shown
range or if the actual number of items has been determined. The estimate
shouldn't be less than two pages (see setPageSize(int)
in the
component) or it causes unnecessary backend requests.
itemCountEstimate
- estimated item count of the backendsetItemCountUnknown()
,
setItemCountEstimateIncrease(int)
int getItemCountEstimate()
setItemCountEstimate(int)
void setItemCountEstimateIncrease(int itemCountEstimateIncrease)
As an example, with an estimate of 1000
and an increase of
500
, when scrolling down the item count will be:
1000, 1500, 2000, 2500...
until the backend runs out of items.
NOTE: the given increase should not be less than the
setPageSize(int)
set in the component, or there will be
unnecessary backend requests.
itemCountEstimateIncrease
- how much the item count estimate is increasedsetItemCountEstimate(int)
int getItemCountEstimateIncrease()
setItemCountEstimateIncrease(int)
void setItemCountUnknown()
The default initial item count and how much the item count is increased
depends on the component. These values can be customized with
setItemCountEstimate(int)
and
setItemCountEstimateIncrease(int)
when the backend has a lot of
items and faster scrolling down is desired.
Copyright © 2021. All rights reserved.