T - the type of the data table recordspublic class LocalListScrollingDataSource<T> extends Object implements DataStore<T>
DataStore that wraps an in-memory/local list of records allowing
the data table to use features like pagination and sorting and will keep load data into the data
table in append mode as we scroll to the bottom of the data table| Constructor and Description |
|---|
LocalListScrollingDataSource(int pageSize)
Creates and instance with a custom page size and empty data list
|
LocalListScrollingDataSource(List<T> data,
int pageSize)
Creates and instance with an initial data list and a custom page size
|
| Modifier and Type | Method and Description |
|---|---|
List<T> |
getFiltered() |
RecordsSorter<T> |
getRecordsSorter() |
SearchFilter<T> |
getSearchFilter() |
void |
handleEvent(TableEvent event)
this store will listen to the following events
|
void |
load()
loads the data into the data table
|
void |
onDataChanged(StoreDataChangeListener<T> dataChangeListener)
Adds a listener to handle the
DataChangedEvent events |
void |
removeDataChangeListener(StoreDataChangeListener<T> dataChangeListener)
removes the listener
|
void |
setData(List<T> data)
sets new data list overriding the existing one, and clears all filters, then loads it in the
data table
|
LocalListScrollingDataSource<T> |
setRecordsSorter(RecordsSorter<T> recordsSorter)
Sets the records sorting for this data store
|
LocalListScrollingDataSource<T> |
setSearchFilter(SearchFilter<T> searchFilter)
Sets a search filter, when ever the data store receives a
SearchEvent it will use this
search filter to filter the data list |
public LocalListScrollingDataSource(int pageSize)
pageSize - int, Page sizepublic SearchFilter<T> getSearchFilter()
SearchFilter if exists, otherwise return
nullpublic LocalListScrollingDataSource<T> setSearchFilter(SearchFilter<T> searchFilter)
SearchEvent it will use this
search filter to filter the data listsearchFilter - SearchFilterpublic RecordsSorter<T> getRecordsSorter()
RecordsSorter used in this data storepublic LocalListScrollingDataSource<T> setRecordsSorter(RecordsSorter<T> recordsSorter)
recordsSorter - RecordsSorterpublic void setData(List<T> data)
data - the new List of recordspublic void onDataChanged(StoreDataChangeListener<T> dataChangeListener)
DataChangedEvent eventsonDataChanged in interface DataStore<T>dataChangeListener - StoreDataChangeListenerpublic void removeDataChangeListener(StoreDataChangeListener<T> dataChangeListener)
removeDataChangeListener in interface DataStore<T>dataChangeListener - StoreDataChangeListenerpublic void load()
public void handleEvent(TableEvent event)
BodyScrollEvent
SortEvent
TablePageChangeEvent
handleEvent in interface TableEventListenerevent - the TableEvent being receivedCopyright © 2019–2022 Dominokit. All rights reserved.