T - the type of the data table recordspublic class TableConfig<T> extends Object implements HasMultiSelectionSupport<TableConfig<T>>
TableConfig<Contact> tableConfig = new TableConfig<>();
tableConfig
.addColumn(ColumnConfig.| Modifier and Type | Class and Description |
|---|---|
static class |
TableConfig.ColumnNofFoundException
This exception is thrown when performing action that looks up a column by its name but the
column does not exist in the current
TableConfig |
static interface |
TableConfig.RowAppender<T>
An interface to provide an alternative implementation of how rows should be appended to the
table
|
static interface |
TableConfig.UtilityColumnHandler<T> |
| Constructor and Description |
|---|
TableConfig() |
| Modifier and Type | Method and Description |
|---|---|
TableConfig<T> |
addColumn(ColumnConfig<T> column)
Adds a configuration for a column in the data table
|
TableConfig<T> |
addPlugin(DataTablePlugin<T> plugin)
Adds a new plugin to the data table
|
void |
drawHeaders(DataTable<T> dataTable,
DominoElement<elemental2.dom.HTMLTableSectionElement> thead)
This method will draw the table columns header elements for all columns and append them to the
table head element
|
void |
drawRecord(DataTable<T> dataTable,
TableRow<T> tableRow)
Draw a record as a row in the data table, row information is obtained from the TableRow
|
ColumnConfig<T> |
getColumnByName(String name)
get a column config by the column name
|
List<ColumnConfig<T>> |
getColumns() |
DataTable<T> |
getDataTable() |
String |
getFixedBodyHeight() |
String |
getFixedDefaultColumnWidth() |
List<DataTablePlugin<T>> |
getPlugins() |
List<ColumnConfig<T>> |
getVisibleColumns() |
TableConfig<T> |
insertColumnFirst(ColumnConfig<T> column)
Adds a configuration for a column in the data table as the first column over the existing
columns list
|
TableConfig<T> |
insertColumnLast(ColumnConfig<T> column)
Adds a configuration for a column in the data table as the last column after the existing
columns list
|
boolean |
isFixed() |
boolean |
isLazyLoad() |
boolean |
isMultiSelect() |
TableConfig<T> |
onUtilityColumn(TableConfig.UtilityColumnHandler<T> utilityColumnHandler) |
TableConfig<T> |
setDirtyRecordHandlers(DirtyRecordProvider<T> dirtyRecordProvider,
SaveDirtyRecordHandler<T> saveDirtyRecordHandler)
sets the dirty record handlers for editable tables
|
TableConfig<T> |
setFixed(boolean fixed) |
TableConfig<T> |
setFixedBodyHeight(String fixedBodyHeight) |
TableConfig<T> |
setFixedDefaultColumnWidth(String fixedDefaultColumnWidth) |
TableConfig<T> |
setLazyLoad(boolean lazyLoad) |
TableConfig<T> |
setMultiSelect(boolean multiSelect) |
void |
setRowAppender(TableConfig.RowAppender<T> rowAppender)
Change the default RowAppender for the data table
|
TableConfig<T> |
setUtilityColumnTitle(String title) |
public void drawHeaders(DataTable<T> dataTable, DominoElement<elemental2.dom.HTMLTableSectionElement> thead)
dataTable - the DataTable initialized with this configurationthead - the DominoElement of HTMLTableSectionElement that is the table
header elementpublic void drawRecord(DataTable<T> dataTable, TableRow<T> tableRow)
public TableConfig<T> addColumn(ColumnConfig<T> column)
column - ColumnConfigpublic TableConfig<T> insertColumnFirst(ColumnConfig<T> column)
column - ColumnConfigpublic TableConfig<T> insertColumnLast(ColumnConfig<T> column)
column - ColumnConfigpublic TableConfig<T> addPlugin(DataTablePlugin<T> plugin)
plugin - DataTablePluginpublic TableConfig<T> onUtilityColumn(TableConfig.UtilityColumnHandler<T> utilityColumnHandler)
public boolean isFixed()
public TableConfig<T> setFixed(boolean fixed)
fixed - boolean, if true then this table will have a fixed width and wont change the
columns width when resized, otherwise columns will stretch to match the table root element
widthpublic boolean isLazyLoad()
public TableConfig<T> setLazyLoad(boolean lazyLoad)
lazyLoad - boolean, if true the table will only start loading the data from the data store
if load is called manually, otherwise it will automatically load the data when it is
initializedpublic String getFixedBodyHeight()
setFixedBodyHeight(String) not the actual current table body heightpublic TableConfig<T> setFixedBodyHeight(String fixedBodyHeight)
fixedBodyHeight - boolean, if true the height of the table body will be fixed to the
specified value and while adding records to the table if the total height of rows exceed
this height scroll bars will show up, otherwise the table body will not fixed and will grow
to match the rows height and wont show scrollbarspublic String getFixedDefaultColumnWidth()
public TableConfig<T> setFixedDefaultColumnWidth(String fixedDefaultColumnWidth)
fixedDefaultColumnWidth - String default value to be used as width for the fixed width
columnspublic boolean isMultiSelect()
isMultiSelect in interface HasMultiSelectionSupport<TableConfig<T>>public TableConfig<T> setMultiSelect(boolean multiSelect)
setMultiSelect in interface HasMultiSelectionSupport<TableConfig<T>>multiSelect - boolean, true if the component should support multi-selection, otherwise
falsepublic void setRowAppender(TableConfig.RowAppender<T> rowAppender)
rowAppender - TableConfig.RowAppenderpublic List<DataTablePlugin<T>> getPlugins()
List of plugins added to the tablepublic List<ColumnConfig<T>> getColumns()
List of all ColumnConfig added to the tablepublic List<ColumnConfig<T>> getVisibleColumns()
List of all currently visible ColumnConfig of the tablepublic ColumnConfig<T> getColumnByName(String name)
name - String name of the columnColumnConfig if exists otherwise throw TableConfig.ColumnNofFoundExceptionpublic TableConfig<T> setUtilityColumnTitle(String title)
public DataTable<T> getDataTable()
DataTable initialized with this configurationpublic TableConfig<T> setDirtyRecordHandlers(DirtyRecordProvider<T> dirtyRecordProvider, SaveDirtyRecordHandler<T> saveDirtyRecordHandler)
dirtyRecordProvider - DirtyRecordProvidersaveDirtyRecordHandler - SaveDirtyRecordHandlerCopyright © 2019–2022 Dominokit. All rights reserved.