1. Domino UI
  2. Data table
  3. Basic table
Top Basic Docs

Basic table

Represents a flexible and feature-rich data table for displaying and interacting with data. The DataTable provides features like column configurations, event listeners, row selection, row filtering, etc. for working with both tabular data and hierarchical data structures.

T

the type of data to be displayed in the table

See also :

Configuration class for setting up a DataTable.

This class provides mechanisms to define columns, plugins, and many other configurations needed to draw and interact with a DataTable.

Usage example:

 
 TableConfig< MyData>  config = new TableConfig<> ();
 config.addColumn(ColumnConfig.create("name", "Name").setWidth("100px"))
      .addPlugin(new MyPlugin())
      .setLazyLoad(true);
 DataTable< MyData>  table = new DataTable<> (config);
 
Configuration class for setting up a DataTable.

This class provides mechanisms to define columns, plugins, and many other configurations needed to draw and interact with a DataTable.

Usage example:

 
 TableConfig< MyData>  config = new TableConfig<> ();
 config.addColumn(ColumnConfig.create("name", "Name").setWidth("100px"))
      .addPlugin(new MyPlugin())
      .setLazyLoad(true);
 DataTable< MyData>  table = new DataTable<> (config);
 

Examples

Basic table By default a table will auto-fit columns and allow custom cell content.

API Docs: DataTable

Constructors

public void DataTable(TableConfig<T> tableConfig, DataStore<T> dataStore)
Constructs a DataTable with the provided table configuration and data store.

tableConfig

Configuration details of the table.

dataStore

Data storage handler to fetch and manipulate data for the table.

Public methods

public DataStore<T> getDataStore()
Returns the data store associated with this data table.

Returns:

the associated DataStore instance.

public DataTable<T> redraw()
Redraws the data table by updating the headers and reloading the data.

Returns:

the current DataTable instance

public DataTable<T> load()
Loads the data into the data table.

Returns:

the current DataTable instance

public DataTable<T> setData(List<T> data)
Sets the provided data to the data table.

data

the list of data to be set



Returns:

the current DataTable instance

public DataTable<T> appendData(List<T> newData)
Appends the provided data to the existing data in the table.

newData

the new data to be appended



Returns:

the current DataTable instance

public Collection<T> getData()
Returns the current data present in the table.

Returns:

the collection of data in the table

public DataTable<T> setCondensed(boolean condensed)
Sets the condensed style for the data table.

condensed

a boolean indicating whether to enable the condensed style



Returns:

the current DataTable instance

public boolean isCondensed()
Checks if the data table has a condensed style.

Returns:

a boolean indicating if the table is condensed

public DataTable<T> setHover(boolean hover)
Enables or disables the hover effect for the data table rows.

hover

a boolean indicating whether to enable the hover effect



Returns:

the current DataTable instance

public boolean isHover()
Checks if the hover effect is enabled for the data table rows.

Returns:

a boolean indicating if the hover effect is enabled

public DataTable<T> setBordered(boolean bordered)
Sets the bordered style for the data table.

bordered

a boolean indicating whether to enable the bordered style



Returns:

the current DataTable instance

public boolean isBordered()
Checks if the data table has a bordered style.

Returns:

a boolean indicating if the table is bordered

public DataTable<T> setStriped(boolean striped)
Sets the striped style for the data table rows.

striped

a boolean indicating whether to enable the striped style



Returns:

the current DataTable instance

public boolean isStriped()
Checks if the striped style is enabled for the data table rows.

Returns:

a boolean indicating if the striped style is enabled

public DataTable<T> edit()
Initiates the edit mode for all rows in the data table.

Returns:

the current DataTable instance

public DataTable<T> save()
Saves any edits made to all rows in the data table.

Returns:

the current DataTable instance

public DataTable<T> cancelEditing()
Cancels the edit mode and discards any unsaved changes for all rows in the data table.

Returns:

the current DataTable instance

public TableElement tableElement()
Retrieves the main table element associated with the data table.

Returns:

the table element

public TBodyElement bodyElement()
Retrieves the body element of the table, which contains the data rows.

Returns:

the table body element

public THeadElement headerElement()
Retrieves the header element of the table, which contains the column headers.

Returns:

the table header element

public TFootElement footerElement()
Retrieves the footer element of the table, which might contain summary rows or other additional information.

Returns:

the table footer element

public TableConfig<T> getTableConfig()
Retrieves the configuration object associated with the data table, which defines columns, plugins, and other table settings.

Returns:

the table configuration object

public DataTable<T> filterRows(LocalRowFilter<T> rowFilter)
Applies a provided filter to each row in the data table. Rows that pass the filter remain visible, while rows that fail the filter are marked as filtered and potentially hidden or styled differently.

rowFilter

the filter to apply to each row in the table



Returns:

the current DataTable instance

public DataTable<T> clearRowFilters()
Removes any previously applied filters, making all rows visible.

Returns:

the current DataTable instance

public HTMLDivElement element()
Retrieves the root element associated with the data table.

Returns:

the root element of the data table

public List<TableRow<T>> getSelectedItems()
Retrieves a list of all the table rows that are currently selected.

Returns:

a list of selected table rows

public List<T> getSelectedRecords()
Retrieves a list of the records associated with the table rows that are currently selected.

Returns:

a list of records corresponding to selected table rows

public List<TableRow<T>> getRows()
Retrieves a list of all the table rows.

Returns:

a list of all table rows

public List<TableRow<T>> getRootRows()
Retrieves a list of all the root table rows.

Returns:

a list of root table rows

public Optional<TableRow<T>> getRecordRow(T record)
Retrieves the table row containing the specified record.

record

the record to find in the table rows



Returns:

an Optional containing the matching table row if found, or an empty Optional if no matching row is found

public List<T> getRecords()
Retrieves a list of records associated with the root table rows.

Returns:

a list of records corresponding to root table rows

public List<T> getDirtyRecords()
Retrieves a list of records that have been modified.

Returns:

a list of modified records

public void selectAll()
Selects all rows in the table, without any conditions.
public DataTable<T> selectAll(SelectionCondition<T> selectionCondition)
Selects all rows in the table that meet the provided selection condition.

selectionCondition

the condition determining which rows should be selected



Returns:

the current DataTable instance

public void deselectAll()
Deselects all rows in the table, without any conditions.
public DataTable<T> deselectAll(SelectionCondition<T> selectionCondition)
Deselects all rows in the table that meet the provided selection condition.

selectionCondition

the condition determining which rows should be deselected



Returns:

the current DataTable instance

public DataTable<T> selectRows(Collection<TableRow<T>> rows)
Selects a collection of table rows.

rows

the collection of table rows to be selected



Returns:

the current DataTable instance

public DataTable<T> deselectRows(Collection<TableRow<T>> rows)
Deselects a collection of table rows.

rows

the collection of table rows to be deselected



Returns:

the current DataTable instance

public DataTable<T> selectRecords(Collection<T> records)
Selects a collection of records.

records

the collection of records to be selected



Returns:

the current DataTable instance

public DataTable<T> deselectRecords(Collection<T> records)
Deselects a collection of records.

records

the collection of records to be deselected



Returns:

the current DataTable instance

public boolean isSelectable()
Determines if the table rows are selectable.

Returns:

true if selectable, false otherwise

public DataTable<T> pauseSelectionListeners()
Pauses the execution of selection listeners.

Returns:

the current DataTable instance

public DataTable<T> resumeSelectionListeners()
Resumes the execution of selection listeners.

Returns:

the current DataTable instance

public DataTable<T> togglePauseSelectionListeners(boolean toggle)
Toggles the pausing of selection listeners based on the provided value.

toggle

true to pause the listeners, false to resume



Returns:

the current DataTable instance

public Set<SelectionListener<? super TableRow<T>, ? super List<TableRow<T>>>> getSelectionListeners()
Retrieves the set of selection listeners.

Returns:

a set of selection listeners

public Set<SelectionListener<? super TableRow<T>, ? super List<TableRow<T>>>> getDeselectionListeners()
Retrieves the set of deselection listeners.

Returns:

a set of deselection listeners

public boolean isSelectionListenersPaused()
Determines if the selection listeners are currently paused.

Returns:

true if the listeners are paused, false otherwise

public DataTable<T> triggerSelectionListeners(TableRow<T> source, List<TableRow<T>> selection)
Triggers the registered selection listeners.

source

the source TableRow that caused the selection change

selection

the list of currently selected rows



Returns:

the current DataTable instance

public DataTable<T> triggerDeselectionListeners(TableRow<T> source, List<TableRow<T>> selection)
Triggers the registered deselection listeners.

source

the source TableRow that caused the deselection

selection

the list of currently selected rows



Returns:

the current DataTable instance

public List<TableRow<T>> getSelection()
Retrieves the currently selected table rows.

Returns:

a list of selected table rows

public DataTable<T> addTableEventListener(String type, DominoEventListener listener)
Registers a table event listener for the specified event type.

type

the event type

listener

the listener to be added



Returns:

the current DataTable instance

public DataTable<T> removeTableListener(String type, DominoEventListener listener)
Removes a registered table event listener for the specified event type.

type

the event type

listener

the listener to be removed



Returns:

the current DataTable instance

public DataTable<T> fireTableEvent(TableEvent tableEvent)
Fires a specified table event.

tableEvent

the event to fire



Returns:

the current DataTable instance

public SearchContext<T> getSearchContext()
Retrieves the current search context.

Returns:

the current search context

public DataTable<T> setRemoveRecordsHandler(RemoveRowsHandler<T> removeRecordsHandler)
Sets the handler for removing records.

removeRecordsHandler

the handler to set



Returns:

the current DataTable instance

public DynamicStyleSheet<HTMLDivElement, DataTable<T>> getDynamicStyleSheet()
Retrieves the dynamic style sheet associated with the DataTable.

Returns:

the dynamic style sheet

public DataTable<T> appendChild(Node node)
Appends a given node to the table. If a dynamic stylesheet is set, it will also append the style element of that stylesheet to the root element.

node

the node to be appended



Returns:

the current DataTable instance

public DataTable<T> appendChild(String text)
Appends a given text as a text node to the table. If a dynamic stylesheet is set, it will also append the style element of that stylesheet to the root element.

text

the text to be appended as a text node



Returns:

the current DataTable instance

public DataTable<T> withTable(ChildHandler<DataTable<T>, TableElement> handler)
Provides direct access to the table element to apply custom configurations.

handler

the handler that defines the operations to be performed on the table element



Returns:

the current DataTable instance

public DataTable<T> withTableBody(ChildHandler<DataTable<T>, TBodyElement> handler)
Provides direct access to the table body element to apply custom configurations.

handler

the handler that defines the operations to be performed on the table body element



Returns:

the current DataTable instance

public DataTable<T> withTableFooter(ChildHandler<DataTable<T>, TFootElement> handler)
Provides direct access to the table footer element to apply custom configurations.

handler

the handler that defines the operations to be performed on the table footer element



Returns:

the current DataTable instance

public DataTable<T> withTableHead(ChildHandler<DataTable<T>, THeadElement> handler)
Provides direct access to the table head element to apply custom configurations.

handler

the handler that defines the operations to be performed on the table head element



Returns:

the current DataTable instance

public DataTable<T> appendChild(IsElement<?> isElement)
Appends a given element to the table. If a dynamic stylesheet is set, it will also append the style element of that stylesheet to the root element.

isElement

the element to be appended



Returns:

the current DataTable instance

API Docs: TableConfig

Public methods

public void drawHeaders(DataTable<T> dataTable, THeadElement thead)
Draws headers of the DataTable based on the provided configurations.

dataTable

The DataTable for which headers are to be drawn.

thead

The table header element.

public void drawRecord(DataTable<T> dataTable, TableRow<T> tableRow)
Draws a record (row) in the provided DataTable based on the configuration and applies the appropriate CSS.

This method will render the table row, apply a CSS class based on its index (odd or even), and append it to the DataTable either directly or using the associated RowAppenderMeta. After the row is added, it will notify all associated plugins.

dataTable

The DataTable in which the record is to be drawn.

tableRow

The table row that represents the record.

public TableConfig<T> addColumn(ColumnConfig<T> column)
Adds a column to the configuration.

column

Column configuration.



Returns:

Current instance of TableConfig for chaining.

public TableConfig<T> insertColumnFirst(ColumnConfig<T> column)
Inserts a new column configuration at the beginning of the list of columns.

column

The column configuration to be added.



Returns:

The current instance of TableConfig for chaining.

public TableConfig<T> insertColumnLast(ColumnConfig<T> column)
Inserts a new column configuration at the position before the last column in the list.

column

The column configuration to be added.



Returns:

The current instance of TableConfig for chaining.

public TableConfig<T> addPlugin(DataTablePlugin<T> plugin)
Adds a new plugin to the DataTable and checks if a utility column is required by the plugin. If the plugin requires a utility column and one isn't already added, the utility column is inserted at the beginning.

plugin

The DataTablePlugin to be added.



Returns:

The current instance of TableConfig for chaining.

public TableConfig<T> onUtilityColumn(UtilityColumnHandler<T> utilityColumnHandler)
Sets the handler for utility columns in the DataTable configuration.

utilityColumnHandler

The handler for utility columns.



Returns:

The current instance of TableConfig for chaining.

public boolean isFixed()
Checks if the DataTable is in a fixed layout mode.

Returns:

true if the table layout is fixed, false otherwise.

@deprecated use {@link #getTableMode()} instead
public TableConfig<T> setFixed(boolean fixed)
Sets the DataTable layout mode as fixed or fluid.

fixed

true to set the table layout as fixed, false for fluid.



Returns:

The current instance of TableConfig for chaining.

@deprecated use {@link #setTableMode(TableMode)} instead
public TableConfig<T> setTableMode(TableMode tableMode)
Sets the table mode for the table configuration.

tableMode

the mode to set for the table, defining its operational behavior or format



Returns:

the updated TableConfig instance with the newly set table mode

public TableMode getTableMode()
Retrieves the current mode of the table.

Returns:

the current TableMode instance representing the table's mode.

public boolean isLazyLoad()
Checks if the DataTable is in lazy load mode.

Returns:

true if the table is set to lazy load mode, false otherwise.

public TableConfig<T> setLazyLoad(boolean lazyLoad)
Enables or disables the lazy load mode for the DataTable.

lazyLoad

true to enable lazy load mode, false to disable.



Returns:

The current instance of TableConfig for chaining.

public String getFixedBodyHeight()
Retrieves the fixed height for the table body when in fixed layout mode.

Returns:

A string representing the fixed height, e.g., "200px".

public TableConfig<T> setFixedBodyHeight(String fixedBodyHeight)
Sets the fixed height for the table body when in fixed layout mode.

fixedBodyHeight

The height as a string, e.g., "200px".



Returns:

The current instance of TableConfig for chaining.

public String getFixedDefaultColumnWidth()
Retrieves the default width for columns in the fixed layout mode.

Returns:

A string representing the default column width, e.g., "100px".

public TableConfig<T> setFixedDefaultColumnWidth(String fixedDefaultColumnWidth)
Sets the default width for columns when in fixed layout mode.

fixedDefaultColumnWidth

The width as a string, e.g., "100px".



Returns:

The current instance of TableConfig for chaining.

public boolean isMultiSelect()
Checks if the DataTable supports multi-selection.

Returns:

true if multi-selection is enabled, false otherwise.

public TableConfig<T> setMultiSelect(boolean multiSelect)
Sets the multi-selection mode for the DataTable.

multiSelect

true to enable multi-selection mode, false to disable.



Returns:

The current instance of TableConfig for chaining.

public void setRowAppender(RowAppender<T> rowAppender)
Sets the row appender for the DataTable. It is ignored if the provided appender is null.

rowAppender

The row appender to set.

public List<DataTablePlugin<T>> getPlugins()
Retrieves the list of plugins attached to the DataTable, sorted in their natural order.

Returns:

A sorted list of DataTablePlugin .

public List<ColumnConfig<T>> getColumns()
Retrieves the leaf columns of the DataTable.

Returns:

A list of ColumnConfig representing the leaf columns.

public List<ColumnConfig<T>> getFlattenColumns()
Retrieves all the columns of the DataTable, including nested columns if any.

Returns:

A list of ColumnConfig representing all columns, flattened.

public List<ColumnConfig<T>> getLeafColumns()
Retrieves only the leaf columns of the data table.

Returns:

A list of ColumnConfig representing all columns, flattened.

public List<ColumnConfig<T>> getColumnsGrouped()
Retrieves the columns of the DataTable as grouped.

Returns:

A list of ColumnConfig representing grouped columns.

public List<ColumnConfig<T>> getVisibleColumns()
Retrieves only the visible columns of the DataTable.

Returns:

A list of ColumnConfig representing visible columns.

public ColumnConfig<T> getColumnByName(String name)
Retrieves a column configuration by its name.

name

The name of the column to retrieve.



Returns:

The ColumnConfig associated with the given name.

@throws ColumnNofFoundException If no column is found with the specified name.
public Optional<ColumnConfig<T>> findColumnByName(String name)
Retrieves a column configuration by its name.

name

The name of the column to retrieve.



Returns:

The ColumnConfig associated with the given name.

@throws ColumnNofFoundException If no column is found with the specified name.
public int getColumnIndexByName(String name)
Returns the index of the first column whose name matches the given value.

This method searches the list of leaf columns (as returned by getLeafColumns ) for the first ColumnConfig whose name equals the specified name . If such a column is found, its index within the leaf column list is returned. If no matching column exists, -1 is returned.

name

the name of the column to search for; must not be null



Returns:

the index of the first matching column, or -1 if no column matches

public TableConfig<T> setUtilityColumnTitle(String title)
Sets the title for the utility column.

title

The title to set for the utility column.



Returns:

The current instance of TableConfig for chaining.

public DataTable<T> getDataTable()
Retrieves the associated DataTable instance.

Returns:

The DataTable associated with this configuration.

public TableConfig<T> setDirtyRecordHandlers(DirtyRecordProvider<T> dirtyRecordProvider, SaveDirtyRecordHandler<T> saveDirtyRecordHandler)
Configures handlers for managing dirty records.

dirtyRecordProvider

The provider to detect dirty records.

saveDirtyRecordHandler

The handler to save dirty records.



Returns:

The current instance of TableConfig for chaining.

public String getWidth()
Retrieves the width of the table.

Returns:

The width of the table.

public TableConfig<T> setWidth(String width)
Sets the width of the table.

width

The width to set.



Returns:

The current instance of TableConfig for chaining.

public String getMaxWidth()
Retrieves the maximum width of the table.

Returns:

The maximum width of the table.

public TableConfig<T> setMaxWidth(String maxWidth)
Sets the maximum width of the table.

maxWidth

The maximum width to set.



Returns:

The current instance of TableConfig for chaining.

public String getMinWidth()
Retrieves the minimum width of the table.

Returns:

The minimum width of the table.

public boolean isStickyHeader()
Checks if the header of the table is sticky.

Returns:

true if the header is sticky, false otherwise.

public TableConfig<T> setStickyHeader(boolean stickyHeader)
Sets the sticky state of the table header.

stickyHeader

true to make the header sticky, false to disable.



Returns:

The current instance of TableConfig for chaining.

public TableConfig<T> setMinWidth(String minWidth)
Sets the minimum width of the table.

minWidth

The minimum width to set.



Returns:

The current instance of TableConfig for chaining.

public TableConfig<T> setOnRowEditHandler(Consumer<TableRow<T>> handler)
Use this to set a handler that will be called when ever a row is being edited.

handler

The handler to be called.



Returns:

same TableConfig instance.

public TableConfig<T> setOnRowFinishEditHandler(Consumer<TableRow<T>> handler)
Use this to set a handler that will be called when ever a row editing finished.

handler

The handler to be called.



Returns:

same TableConfig instance.

public TableConfig<T> withUtilityColumn(ChildHandler<TableConfig<T>, ColumnConfig<T>> handler)
Adds a utility column to the table configuration by applying the specified handler.

handler

a ChildHandler instance that allows custom configuration of the utility column.



Returns:

the updated TableConfig instance.

API Docs: ColumnConfig

Public methods

public void drawHeaders(DataTable<T> dataTable, THeadElement thead)
Draws headers of the DataTable based on the provided configurations.

dataTable

The DataTable for which headers are to be drawn.

thead

The table header element.

public void drawRecord(DataTable<T> dataTable, TableRow<T> tableRow)
Draws a record (row) in the provided DataTable based on the configuration and applies the appropriate CSS.

This method will render the table row, apply a CSS class based on its index (odd or even), and append it to the DataTable either directly or using the associated RowAppenderMeta. After the row is added, it will notify all associated plugins.

dataTable

The DataTable in which the record is to be drawn.

tableRow

The table row that represents the record.

public TableConfig<T> addColumn(ColumnConfig<T> column)
Adds a column to the configuration.

column

Column configuration.



Returns:

Current instance of TableConfig for chaining.

public TableConfig<T> insertColumnFirst(ColumnConfig<T> column)
Inserts a new column configuration at the beginning of the list of columns.

column

The column configuration to be added.



Returns:

The current instance of TableConfig for chaining.

public TableConfig<T> insertColumnLast(ColumnConfig<T> column)
Inserts a new column configuration at the position before the last column in the list.

column

The column configuration to be added.



Returns:

The current instance of TableConfig for chaining.

public TableConfig<T> addPlugin(DataTablePlugin<T> plugin)
Adds a new plugin to the DataTable and checks if a utility column is required by the plugin. If the plugin requires a utility column and one isn't already added, the utility column is inserted at the beginning.

plugin

The DataTablePlugin to be added.



Returns:

The current instance of TableConfig for chaining.

public TableConfig<T> onUtilityColumn(UtilityColumnHandler<T> utilityColumnHandler)
Sets the handler for utility columns in the DataTable configuration.

utilityColumnHandler

The handler for utility columns.



Returns:

The current instance of TableConfig for chaining.

public boolean isFixed()
Checks if the DataTable is in a fixed layout mode.

Returns:

true if the table layout is fixed, false otherwise.

@deprecated use {@link #getTableMode()} instead
public TableConfig<T> setFixed(boolean fixed)
Sets the DataTable layout mode as fixed or fluid.

fixed

true to set the table layout as fixed, false for fluid.



Returns:

The current instance of TableConfig for chaining.

@deprecated use {@link #setTableMode(TableMode)} instead
public TableConfig<T> setTableMode(TableMode tableMode)
Sets the table mode for the table configuration.

tableMode

the mode to set for the table, defining its operational behavior or format



Returns:

the updated TableConfig instance with the newly set table mode

public TableMode getTableMode()
Retrieves the current mode of the table.

Returns:

the current TableMode instance representing the table's mode.

public boolean isLazyLoad()
Checks if the DataTable is in lazy load mode.

Returns:

true if the table is set to lazy load mode, false otherwise.

public TableConfig<T> setLazyLoad(boolean lazyLoad)
Enables or disables the lazy load mode for the DataTable.

lazyLoad

true to enable lazy load mode, false to disable.



Returns:

The current instance of TableConfig for chaining.

public String getFixedBodyHeight()
Retrieves the fixed height for the table body when in fixed layout mode.

Returns:

A string representing the fixed height, e.g., "200px".

public TableConfig<T> setFixedBodyHeight(String fixedBodyHeight)
Sets the fixed height for the table body when in fixed layout mode.

fixedBodyHeight

The height as a string, e.g., "200px".



Returns:

The current instance of TableConfig for chaining.

public String getFixedDefaultColumnWidth()
Retrieves the default width for columns in the fixed layout mode.

Returns:

A string representing the default column width, e.g., "100px".

public TableConfig<T> setFixedDefaultColumnWidth(String fixedDefaultColumnWidth)
Sets the default width for columns when in fixed layout mode.

fixedDefaultColumnWidth

The width as a string, e.g., "100px".



Returns:

The current instance of TableConfig for chaining.

public boolean isMultiSelect()
Checks if the DataTable supports multi-selection.

Returns:

true if multi-selection is enabled, false otherwise.

public TableConfig<T> setMultiSelect(boolean multiSelect)
Sets the multi-selection mode for the DataTable.

multiSelect

true to enable multi-selection mode, false to disable.



Returns:

The current instance of TableConfig for chaining.

public void setRowAppender(RowAppender<T> rowAppender)
Sets the row appender for the DataTable. It is ignored if the provided appender is null.

rowAppender

The row appender to set.

public List<DataTablePlugin<T>> getPlugins()
Retrieves the list of plugins attached to the DataTable, sorted in their natural order.

Returns:

A sorted list of DataTablePlugin .

public List<ColumnConfig<T>> getColumns()
Retrieves the leaf columns of the DataTable.

Returns:

A list of ColumnConfig representing the leaf columns.

public List<ColumnConfig<T>> getFlattenColumns()
Retrieves all the columns of the DataTable, including nested columns if any.

Returns:

A list of ColumnConfig representing all columns, flattened.

public List<ColumnConfig<T>> getLeafColumns()
Retrieves only the leaf columns of the data table.

Returns:

A list of ColumnConfig representing all columns, flattened.

public List<ColumnConfig<T>> getColumnsGrouped()
Retrieves the columns of the DataTable as grouped.

Returns:

A list of ColumnConfig representing grouped columns.

public List<ColumnConfig<T>> getVisibleColumns()
Retrieves only the visible columns of the DataTable.

Returns:

A list of ColumnConfig representing visible columns.

public ColumnConfig<T> getColumnByName(String name)
Retrieves a column configuration by its name.

name

The name of the column to retrieve.



Returns:

The ColumnConfig associated with the given name.

@throws ColumnNofFoundException If no column is found with the specified name.
public Optional<ColumnConfig<T>> findColumnByName(String name)
Retrieves a column configuration by its name.

name

The name of the column to retrieve.



Returns:

The ColumnConfig associated with the given name.

@throws ColumnNofFoundException If no column is found with the specified name.
public int getColumnIndexByName(String name)
Returns the index of the first column whose name matches the given value.

This method searches the list of leaf columns (as returned by getLeafColumns ) for the first ColumnConfig whose name equals the specified name . If such a column is found, its index within the leaf column list is returned. If no matching column exists, -1 is returned.

name

the name of the column to search for; must not be null



Returns:

the index of the first matching column, or -1 if no column matches

public TableConfig<T> setUtilityColumnTitle(String title)
Sets the title for the utility column.

title

The title to set for the utility column.



Returns:

The current instance of TableConfig for chaining.

public DataTable<T> getDataTable()
Retrieves the associated DataTable instance.

Returns:

The DataTable associated with this configuration.

public TableConfig<T> setDirtyRecordHandlers(DirtyRecordProvider<T> dirtyRecordProvider, SaveDirtyRecordHandler<T> saveDirtyRecordHandler)
Configures handlers for managing dirty records.

dirtyRecordProvider

The provider to detect dirty records.

saveDirtyRecordHandler

The handler to save dirty records.



Returns:

The current instance of TableConfig for chaining.

public String getWidth()
Retrieves the width of the table.

Returns:

The width of the table.

public TableConfig<T> setWidth(String width)
Sets the width of the table.

width

The width to set.



Returns:

The current instance of TableConfig for chaining.

public String getMaxWidth()
Retrieves the maximum width of the table.

Returns:

The maximum width of the table.

public TableConfig<T> setMaxWidth(String maxWidth)
Sets the maximum width of the table.

maxWidth

The maximum width to set.



Returns:

The current instance of TableConfig for chaining.

public String getMinWidth()
Retrieves the minimum width of the table.

Returns:

The minimum width of the table.

public boolean isStickyHeader()
Checks if the header of the table is sticky.

Returns:

true if the header is sticky, false otherwise.

public TableConfig<T> setStickyHeader(boolean stickyHeader)
Sets the sticky state of the table header.

stickyHeader

true to make the header sticky, false to disable.



Returns:

The current instance of TableConfig for chaining.

public TableConfig<T> setMinWidth(String minWidth)
Sets the minimum width of the table.

minWidth

The minimum width to set.



Returns:

The current instance of TableConfig for chaining.

public TableConfig<T> setOnRowEditHandler(Consumer<TableRow<T>> handler)
Use this to set a handler that will be called when ever a row is being edited.

handler

The handler to be called.



Returns:

same TableConfig instance.

public TableConfig<T> setOnRowFinishEditHandler(Consumer<TableRow<T>> handler)
Use this to set a handler that will be called when ever a row editing finished.

handler

The handler to be called.



Returns:

same TableConfig instance.

public TableConfig<T> withUtilityColumn(ChildHandler<TableConfig<T>, ColumnConfig<T>> handler)
Adds a utility column to the table configuration by applying the specified handler.

handler

a ChildHandler instance that allows custom configuration of the utility column.



Returns:

the updated TableConfig instance.

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

Donate & Support Us