When scrolling, this plugin calculates which subset of rows should be rendered based on the current scroll position, row height, and total record count.
Note: This plugin only works with LocalListLiveViewDataStore .
T
the type of the record in the data table
Supports:
Note: This data store is particularly designed to work with the "live view" or virtualized scrolling approach, as implemented by the LiveViewPlugin . It can still be used in standard scenarios but is optimized for incremental loading.
T
the type of data record
public void appendRow(DataTable<T> dataTable, TableRow<T> tableRow)
It also stores the row in an LRU cache, assigning the row an index attribute and setting selection listeners.
dataTable
the data table to which the row should be appended
tableRow
the table row instance representing a single record
public List<T> getSelectedRecords()
a list of selected records
public void handleEvent(DominoEvent event)
event
the table event to handle
public void init(DataTable<T> dataTable)
Performs the following:
rowAppender to use this plugin.dataTable
the data table this plugin is attached to
public void onAllRowsAdded(DataTable<T> dataTable)
dataTable
the data table
public void onBeforeAddRow(DataTable<T> dataTable, TableRow<T> tableRow)
dataTable
the data table
tableRow
the row to be added
public LiveViewPlugin<T> setRowHeight(Integer rowHeight)
rowHeight
the row height in pixels
this plugin instance for method chaining
public void LocalListLiveViewDataStore()
public void LocalListLiveViewDataStore(List<T> data)
data
the list of records to initialize this store with
public List<T> getFilteredRecords()
an unmodifiable list of the currently filtered (and possibly sorted) records
public void setData(List<T> data)
data
the new list of records
public SearchFilter<T> getSearchFilter()
null if no filter is set.
the current SearchFilter , or null
public LocalListLiveViewDataStore<T> setSearchFilter(SearchFilter<T> searchFilter)
searchFilter
the new filter
this instance, for method chaining
public LocalListLiveViewDataStore<T> setAutoSort(boolean autoSort)
autoSort
true to auto-sort data on load, false otherwise
this instance, for method chaining
public LocalListLiveViewDataStore<T> setAutoSortBy(String autoSortBy)
autoSortBy
the sort key
this instance, for method chaining
public LocalListLiveViewDataStore<T> setAutoSortDirection(SortDirection autoSortDirection)
autoSortDirection
the desired SortDirection
this instance, for method chaining
public RecordsSorter<T> getRecordsSorter()
public LocalListLiveViewDataStore<T> setRecordsSorter(RecordsSorter<T> recordsSorter)
List::sort function to apply the comparator.
recordsSorter
the new sorter
this instance, for method chaining
public LocalListLiveViewDataStore<T> setRecordsSorter(RecordsSorter<T> recordsSorter, SortFunction<T> sortFunction)
This can be used to override how the actual sorting is performed, e.g., by calling a custom parallel sort method.
recordsSorter
the records sorter
sortFunction
the function that applies the comparator
this instance, for method chaining
public void onDataChanged(StoreDataChangeListener<T> dataChangeListener)
dataChangeListener
the listener to register
public void onDataChanged(int index, StoreDataChangeListener<T> dataChangeListener)
index
the index position
dataChangeListener
the listener
public void removeDataChangeListener(StoreDataChangeListener<T> dataChangeListener)
dataChangeListener
the listener to remove
public void handleEvent(DominoEvent event)
This data store reacts to:
public void load(boolean flush, int startIndex, int endIndex)
flush is true, the store signals that rows should not be appended but rather replaced.
flush
whether to replace the current rows instead of appending
startIndex
the start index (inclusive)
endIndex
the end index (inclusive)
public void load(int startIndex, int endIndex)
startIndex
the start index (inclusive)
endIndex
the end index (inclusive)
public int getFilteredCount()
the filtered record count
public void load()
This implementation resets the load indexes to cover the same "page size" (delta) from zero to preserve user-defined ranges, then reloads the table.
public void addRecord(T record)
record
the record to add
public void removeRecord(T record)
record
the record to remove
public void updateRecord(T record)
record
the updated record
public void updateRecord(int index, T record)
record
the new record
index
the index to replace
public void updateRecords(Collection<T> records)
records
the records to update
public void updateRecords(int startIndex, Collection<T> records)
startIndex
the initial index to begin updates
records
the records to update
public void addRecords(Collection<T> records)
records
the collection of records to add
public void removeRecord(Collection<T> records)
records
the records to remove
public void removeRecords(Collection<T> records)
records
the records to remove
public List<T> getRecords()
a new list containing the original data
public void setDragDropRecordActions(DragDropRecordActions<T> dragDropRecordActions)
dragDropRecordActions
the new handler