1. Domino UI
  2. Data table
  3. Live grid Pro
Top Live grid Docs

Live grid

A plugin that provides a "live view" or virtualized scrolling for DataTable components backed by a LocalListLiveViewDataStore . It limits the DOM to only the rows currently visible and a small buffer (cache) above and below the viewport, dramatically improving performance for large datasets.

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

A local, in-memory DataStore implementation that supports live (virtual) viewing of data rows. It holds all data in lists and allows incremental loading of a portion of data (by index range) for efficient display with large datasets.

Supports:

  • Filtering via SearchFilter
  • Sorting via RecordsSorter
  • Range-based loading (e.g., partial results) for virtual scrolling
  • Drag-and-drop handling for reordering

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

Examples

Live grid Use virtual scrolling to load huge number of records in the datatable.

API Docs: LiveViewPlugin

Public methods

public void appendRow(DataTable<T> dataTable, TableRow<T> tableRow)
Appends a TableRow to the DataTable . This method is called during the data load process, once for each record that needs to be rendered.

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()
Returns a list of all currently selected records.

Returns:

a list of selected records

public void handleEvent(DominoEvent event)
Handles TableEvent s from the DataTable . Specifically, it listens for search events and resets the scroll to the top when a new search is performed.

event

the table event to handle

public void init(DataTable<T> dataTable)
Initializes this plugin with the provided DataTable .

Performs the following:

  • Validates the data store is a LocalListLiveViewDataStore .
  • Overrides the data table's rowAppender to use this plugin.
  • Sets up scroll listeners and a select-all listener.
  • Configures the data store to reset when data changes (if not in append mode).

dataTable

the data table this plugin is attached to

public void onAllRowsAdded(DataTable<T> dataTable)
Called after all rows in the current load operation have been appended. Updates the placeholder row (sizing row) to represent the full height of the data set, and triggers the final scaling and selection logic.

dataTable

the data table

public void onBeforeAddRow(DataTable<T> dataTable, TableRow<T> tableRow)
Called before a row is added to the table. Calculates the row height if not already set, assigns an index, and sets up position, style, and selection listeners.

dataTable

the data table

tableRow

the row to be added

public LiveViewPlugin<T> setRowHeight(Integer rowHeight)
Manually sets the row height if it is known beforehand.

rowHeight

the row height in pixels



Returns:

this plugin instance for method chaining

API Docs: LocalListLiveViewDataStore

Constructors

public void LocalListLiveViewDataStore()
Creates a new store with empty data.
public void LocalListLiveViewDataStore(List<T> data)
Creates a new store with a custom initial list of data.

data

the list of records to initialize this store with

Public methods

public List<T> getFilteredRecords()


Returns:

an unmodifiable list of the currently filtered (and possibly sorted) records

public void setData(List<T> data)
Replaces all existing data in this store with the specified list, then reloads the table. Any active filters or sorts are cleared, and the table is refreshed.

data

the new list of records

public SearchFilter<T> getSearchFilter()
Returns the current SearchFilter being used by this store, or null if no filter is set.

Returns:

the current SearchFilter , or null

public LocalListLiveViewDataStore<T> setSearchFilter(SearchFilter<T> searchFilter)
Sets a new SearchFilter to be used upon receiving SearchEvent s. When a search event occurs, this filter is applied to original to create the new filtered list.

searchFilter

the new filter



Returns:

this instance, for method chaining

public LocalListLiveViewDataStore<T> setAutoSort(boolean autoSort)
Enables or disables automatic sorting. If enabled, the store will automatically sort the data upon loading using autoSortBy and autoSortDirection .

autoSort

true to auto-sort data on load, false otherwise



Returns:

this instance, for method chaining

public LocalListLiveViewDataStore<T> setAutoSortBy(String autoSortBy)
Sets the default column/field to sort by if autoSort is enabled.

autoSortBy

the sort key



Returns:

this instance, for method chaining

public LocalListLiveViewDataStore<T> setAutoSortDirection(SortDirection autoSortDirection)
Sets the default sort direction (ASC or DESC) if autoSort is enabled.

autoSortDirection

the desired SortDirection



Returns:

this instance, for method chaining

public RecordsSorter<T> getRecordsSorter()
Returns the current RecordsSorter used by this store for sorting.

Returns:

the records sorter

public LocalListLiveViewDataStore<T> setRecordsSorter(RecordsSorter<T> recordsSorter)
Sets the RecordsSorter for this data store, using the default List::sort function to apply the comparator.

recordsSorter

the new sorter



Returns:

this instance, for method chaining

public LocalListLiveViewDataStore<T> setRecordsSorter(RecordsSorter<T> recordsSorter, SortFunction<T> sortFunction)
Sets a RecordsSorter and a custom SortFunction for applying the sort.

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



Returns:

this instance, for method chaining

public void onDataChanged(StoreDataChangeListener<T> dataChangeListener)
Registers a new StoreDataChangeListener that will be notified whenever the data in this store changes (due to searching, sorting, or record manipulation).

dataChangeListener

the listener to register

public void onDataChanged(int index, StoreDataChangeListener<T> dataChangeListener)
Inserts a new data change listener at the specified index in the listener list.

index

the index position

dataChangeListener

the listener

public void removeDataChangeListener(StoreDataChangeListener<T> dataChangeListener)
Removes a previously registered data change listener.

dataChangeListener

the listener to remove

public void handleEvent(DominoEvent event)
Check super implementation documentation.

This data store reacts to:

public void load(boolean flush, int startIndex, int endIndex)
Loads a specified range of the filtered data, optionally flushing the existing rows. If 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)
Loads a specified range of the filtered data without flushing existing rows.

startIndex

the start index (inclusive)

endIndex

the end index (inclusive)

public int getFilteredCount()
Retrieves the number of currently filtered records.

Returns:

the filtered record count

public void load()
Check super implementation documentation.

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)
Appends a single record to the original data set, then updates the table.

record

the record to add

public void removeRecord(T record)
Removes a single record from both the original and filtered lists, then updates the table.

record

the record to remove

public void updateRecord(T record)
Updates an existing record in the data store (via the record's index in original ), then refreshes the table.

record

the updated record

public void updateRecord(int index, T record)
Updates the record at the specified index in original , then refreshes the table.

record

the new record

index

the index to replace

public void updateRecords(Collection<T> records)
Updates multiple records in place, based on their existing positions in original , then triggers a reload.

records

the records to update

public void updateRecords(int startIndex, Collection<T> records)
Updates multiple records in place, starting from a specific index, then reloads. If the index is out of range, the process stops.

startIndex

the initial index to begin updates

records

the records to update

public void addRecords(Collection<T> records)
Adds multiple records to the store, replacing the existing data and triggering a reload.

records

the collection of records to add

public void removeRecord(Collection<T> records)
Removes multiple records from this store (both original and filtered), then updates the table. @deprecated use {@link #removeRecords(Collection)} instead

records

the records to remove

public void removeRecords(Collection<T> records)
Removes multiple records from the store, then updates the table.

records

the records to remove

public List<T> getRecords()
Returns an independent copy of the entire original data list. Modifications to the returned list will not affect this store.

Returns:

a new list containing the original data

public void setDragDropRecordActions(DragDropRecordActions<T> dragDropRecordActions)
Assigns a custom DragDropRecordActions handler to define how records should be moved or removed when drag-and-drop actions occur on the UI.

dragDropRecordActions

the new handler

We are a group of passionate people who love what we do

Donate & Support Us