T - the type of the data table recordspublic class SelectionPlugin<T> extends Object implements DataTablePlugin<T>
TableConfig.isMultiSelect() and fires table selection change events when the user changes the
selection.| Modifier and Type | Class and Description |
|---|---|
static interface |
SelectionPlugin.CheckBoxCreator<T> |
| Constructor and Description |
|---|
SelectionPlugin()
creates an instance with default configurations
|
SelectionPlugin(ColorScheme colorScheme)
create an instance that changes the selected row background color
|
SelectionPlugin(ColorScheme colorScheme,
elemental2.dom.HTMLElement singleSelectIndicator)
create an instance that changes the selected row background color and use a custom selection
indicator icon
|
SelectionPlugin(ColorScheme colorScheme,
org.jboss.elemento.IsElement<?> singleSelectIndicator)
create an instance that changes the selected row background color and use a custom selection
indicator icon
|
| Modifier and Type | Method and Description |
|---|---|
Optional<List<elemental2.dom.HTMLElement>> |
getUtilityElements(DataTable<T> dataTable,
CellRenderer.CellInfo<T> cellInfo) |
void |
onHeaderAdded(DataTable<T> dataTable,
ColumnConfig<T> column)
This method will be called right after adding a column header element to the table
|
boolean |
requiresUtilityColumn() |
SelectionPlugin<T> |
setCheckBoxCreator(SelectionPlugin.CheckBoxCreator<T> checkBoxCreator)
A setter to give the user the ability to customize the selection checkbox
|
SelectionPlugin<T> |
setSelectionCondition(SelectionCondition<T> selectionCondition)
Set a condition to use to determine if a row should be selectable or not
|
SelectionPlugin<T> |
setSingleSelectIcon(BaseIcon<?> singleSelectIcon)
Change the single selection indicator icon
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithandleEvent, init, onAfterAddHeaders, onAfterAddTable, onAllRowsAdded, onBeforeAddHeaders, onBeforeAddRow, onBeforeAddTable, onBodyAdded, onRowAddedpublic SelectionPlugin()
public SelectionPlugin(ColorScheme colorScheme)
colorScheme - ColorScheme the selected row background colorpublic SelectionPlugin(ColorScheme colorScheme, elemental2.dom.HTMLElement singleSelectIndicator)
colorScheme - ColorScheme the selected row background colorsingleSelectIndicator - HTMLElement to use a selection indicatorpublic SelectionPlugin(ColorScheme colorScheme, org.jboss.elemento.IsElement<?> singleSelectIndicator)
colorScheme - ColorScheme the selected row background colorsingleSelectIndicator - IsElement to use a selection indicatorpublic boolean requiresUtilityColumn()
requiresUtilityColumn in interface DataTablePlugin<T>public Optional<List<elemental2.dom.HTMLElement>> getUtilityElements(DataTable<T> dataTable, CellRenderer.CellInfo<T> cellInfo)
getUtilityElements in interface DataTablePlugin<T>dataTable - DataTablecellInfo - CellRenderer.CellInfoOptional List of HTMLElements to be used as part of
the plugins utility column, elements returned from this method will be rendered as flex
items inside the utility cell.public void onHeaderAdded(DataTable<T> dataTable, ColumnConfig<T> column)
DataTablePluginonHeaderAdded in interface DataTablePlugin<T>dataTable - the DataTable we are attaching this plugin to.column - the ColumnConfig of the column we added the header for.public SelectionPlugin<T> setSingleSelectIcon(BaseIcon<?> singleSelectIcon)
singleSelectIcon - BaseIconpublic SelectionPlugin<T> setSelectionCondition(SelectionCondition<T> selectionCondition)
selectionCondition - SelectionConditionpublic SelectionPlugin<T> setCheckBoxCreator(SelectionPlugin.CheckBoxCreator<T> checkBoxCreator)
Copyright © 2019–2022 Dominokit. All rights reserved.