T - the type of the data table recordspublic class ColumnConfig<T> extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
ColumnConfig.CellStyler<T>
A hook interface to style a cell being rendered on the table
|
| Constructor and Description |
|---|
ColumnConfig(String name)
Creates an instance with a name which will also be used as a title
|
ColumnConfig(String name,
String title)
Creates an instance with a name and title
|
| Modifier and Type | Method and Description |
|---|---|
ColumnConfig<T> |
addShowHideListener(ColumnShowHideListener showHideListener)
Adds a listener to listen for column hide/show changes
|
ColumnConfig<T> |
alignCenter()
a shortcut to
setWidth(String) with value center |
ColumnConfig<T> |
alignLeft()
a shortcut to
setWidth(String) with value left |
ColumnConfig<T> |
alignRight()
a shortcut to
setWidth(String) with value right |
void |
applyScreenMedia(elemental2.dom.HTMLTableCellElement element)
force apply screen medias if exists to a cell in this column
|
ColumnConfig<T> |
asHeader() |
void |
clearShowHideListeners()
removes all
ColumnShowHideListeners of this column except the permanent listeners |
void |
clearShowHideListners()
Deprecated.
|
static <T> ColumnConfig<T> |
create(String name)
Creates an instance with a name which will also be used as a title
|
static <T> ColumnConfig<T> |
create(String name,
String title)
Creates an instance with a name and title
|
CellRenderer<T> |
getCellRenderer() |
ColumnConfig.CellStyler<T> |
getCellStyler() |
CellRenderer<T> |
getEditableCellRenderer() |
DominoElement<elemental2.dom.HTMLTableCellElement> |
getHeadElement() |
HeaderElementSupplier |
getHeaderElement()
Deprecated.
|
HeaderElementSupplier |
getHeaderElementSupplier() |
FlexLayout |
getHeaderLayout() |
ColumnConfig.CellStyler<T> |
getHeaderStyler() |
ScreenMedia |
getHideOn() |
String |
getMaxWidth() |
String |
getMinWidth() |
String |
getName() |
ScreenMedia |
getShowOn() |
String |
getSortKey() |
String |
getTextAlign() |
String |
getTitle() |
elemental2.dom.Node |
getTooltipNode() |
String |
getWidth() |
ColumnConfig<T> |
hide()
Hides the column and call the listeners
|
ColumnConfig<T> |
hideOn(ScreenMedia hideOn) |
boolean |
isDrawTitle() |
boolean |
isFixed() |
boolean |
isHeader()
While rendering the column this will determine if we should build the header with th or td
elements
|
boolean |
isHidden() |
boolean |
isPluginColumn() |
boolean |
isShowTooltip() |
boolean |
isSortable() |
boolean |
isUtilityColumn() |
ColumnConfig<T> |
maxWidth(String maxWidth) |
ColumnConfig<T> |
minWidth(String minWidth) |
ColumnConfig<T> |
removeShowHideListener(ColumnShowHideListener showHideListener)
remove the listener
|
ColumnConfig<T> |
setCellRenderer(CellRenderer<T> cellRenderer)
sets the cell renderer for this column
|
ColumnConfig<T> |
setDrawTitle(boolean drawTitle)
Set if the column should render its title or not
|
ColumnConfig<T> |
setEditableCellRenderer(CellRenderer<T> editableCellRenderer)
sets the cell renderer to render this column cells in editable mode
|
ColumnConfig<T> |
setFixed(boolean fixed) |
protected void |
setHeadElement(elemental2.dom.HTMLTableCellElement headElement)
sets a custom element for the column header
|
ColumnConfig<T> |
setHeaderElement(HeaderElementSupplier headerElement)
Deprecated.
|
ColumnConfig<T> |
setHeaderElementSupplier(HeaderElementSupplier headerElement)
Sets a custom header element for the column
|
ColumnConfig<T> |
setPluginColumn(boolean pluginColumn)
flags the columns as a plugin column or not
|
ColumnConfig<T> |
setShowTooltip(boolean showTooltip) |
ColumnConfig<T> |
setSortable(boolean sortable)
set wither the column can be used to sort the data or not
|
ColumnConfig<T> |
setSortable(boolean sortable,
String sortKey)
set wither the column can be used to sort the data or not
|
ColumnConfig<T> |
setTitle(String title) |
ColumnConfig<T> |
setTooltipNode(elemental2.dom.Node tooltipNode)
sets a custom tooltip element
|
ColumnConfig<T> |
setTooltipText(String tooltipText)
sets the tooltip text
|
ColumnConfig<T> |
setWidth(String width) |
ColumnConfig<T> |
show()
show the column and call the listeners
|
ColumnConfig<T> |
showOn(ScreenMedia showOn) |
ColumnConfig<T> |
sortable()
a shortcut for
setSortable(boolean) with value true |
ColumnConfig<T> |
sortable(String sortKey)
a shortcut for
setSortable(boolean) with value true |
ColumnConfig<T> |
styleCell(ColumnConfig.CellStyler<T> cellStyler)
a hook to style a cell in the column
|
ColumnConfig<T> |
styleHeader(ColumnConfig.CellStyler<T> headerStyler)
a hook to style a column header
|
ColumnConfig<T> |
textAlign(String textAlign) |
ColumnConfig<T> |
toggleDisplay(boolean visible) |
public ColumnConfig(String name, String title)
name - String, the name of the columntitle - String, the title of the columnpublic ColumnConfig(String name)
name - String, the name of the columnpublic static <T> ColumnConfig<T> create(String name)
T - the type of the data table recordsname - String, the name of the columnColumnConfig instancepublic static <T> ColumnConfig<T> create(String name, String title)
T - the type of the data table recordsname - String, the name of the columntitle - String, the title of the columnColumnConfig instancepublic String getTitle()
public String getName()
public ColumnConfig<T> asHeader()
public ColumnConfig<T> minWidth(String minWidth)
minWidth - String css minimum width for the columnpublic ColumnConfig<T> maxWidth(String maxWidth)
maxWidth - String css maximum width for the columnpublic String getWidth()
setWidth(String) not the
actual width of the columnpublic ColumnConfig<T> setWidth(String width)
width - String css width for the columnpublic ColumnConfig<T> textAlign(String textAlign)
textAlign - String css text align for the column values
left,right,centerpublic ColumnConfig<T> alignLeft()
setWidth(String) with value leftpublic ColumnConfig<T> alignRight()
setWidth(String) with value rightpublic ColumnConfig<T> alignCenter()
setWidth(String) with value center@Deprecated public HeaderElementSupplier getHeaderElement()
HeaderElementSupplier of the columnpublic HeaderElementSupplier getHeaderElementSupplier()
HeaderElementSupplier of the column@Deprecated public ColumnConfig<T> setHeaderElement(HeaderElementSupplier headerElement)
headerElement - the HeaderElementSupplierpublic ColumnConfig<T> setHeaderElementSupplier(HeaderElementSupplier headerElement)
headerElement - the HeaderElementSupplierpublic boolean isHeader()
public String getMinWidth()
minWidth(String)public String getMaxWidth()
maxWidth(String)public String getTextAlign()
textAlign(String)public boolean isFixed()
public ColumnConfig<T> setFixed(boolean fixed)
fixed - boolean, if true the column width will be fixed and wont change when the table
size is changed.public ColumnConfig<T> setTitle(String title)
public DominoElement<elemental2.dom.HTMLTableCellElement> getHeadElement()
HTMLTableCellElement that represent this column element wrapped as DominoElementprotected void setHeadElement(elemental2.dom.HTMLTableCellElement headElement)
headElement - HTMLTableCellElementpublic CellRenderer<T> getCellRenderer()
CellRenderer of this columnpublic ColumnConfig<T> setCellRenderer(CellRenderer<T> cellRenderer)
cellRenderer - CellRendererpublic CellRenderer<T> getEditableCellRenderer()
CellRenderer of the editable version of this columnpublic ColumnConfig<T> setEditableCellRenderer(CellRenderer<T> editableCellRenderer)
editableCellRenderer - CellRendererpublic ColumnConfig<T> styleHeader(ColumnConfig.CellStyler<T> headerStyler)
headerStyler - ColumnConfig.CellStylerpublic ColumnConfig<T> styleCell(ColumnConfig.CellStyler<T> cellStyler)
cellStyler - ColumnConfig.CellStylerpublic boolean isSortable()
public ColumnConfig<T> setSortable(boolean sortable)
sortable - boolean, if true then data can be sorted with this column, otherwise it cantpublic ColumnConfig<T> setSortable(boolean sortable, String sortKey)
sortable - boolean, if true then data can be sorted with this column, otherwise it cantpublic ColumnConfig<T> sortable()
setSortable(boolean) with value truepublic ColumnConfig<T> sortable(String sortKey)
setSortable(boolean) with value truesortKey - String key for sort propertypublic void applyScreenMedia(elemental2.dom.HTMLTableCellElement element)
element - HTMLTableCellElementpublic elemental2.dom.Node getTooltipNode()
Node representing the tooltip for this column header if exists otherwise
return the title nodepublic ColumnConfig<T> setTooltipNode(elemental2.dom.Node tooltipNode)
tooltipNode - Nodepublic ColumnConfig<T> setTooltipText(String tooltipText)
tooltipText - Stringpublic ColumnConfig<T> setShowTooltip(boolean showTooltip)
showTooltip - boolean, if true a tooltip will show up when hover on the column otherwise
it will not.public ScreenMedia getShowOn()
ScreenMedia that result on showing the columnpublic ColumnConfig<T> showOn(ScreenMedia showOn)
showOn - ScreenMedia when is applied the column will be shownpublic ScreenMedia getHideOn()
ScreenMedia that result on hiding the columnpublic ColumnConfig<T> hideOn(ScreenMedia hideOn)
hideOn - ScreenMedia when is applied the column will be hiddenpublic ColumnConfig.CellStyler<T> getHeaderStyler()
ColumnConfig.CellStyler of the header elementpublic ColumnConfig.CellStyler<T> getCellStyler()
ColumnConfig.CellStyler of the cell elementpublic boolean isShowTooltip()
public ColumnConfig<T> addShowHideListener(ColumnShowHideListener showHideListener)
showHideListener - ColumnShowHideListenerpublic ColumnConfig<T> removeShowHideListener(ColumnShowHideListener showHideListener)
showHideListener - ColumnShowHideListenerpublic ColumnConfig<T> show()
public ColumnConfig<T> hide()
public ColumnConfig<T> toggleDisplay(boolean visible)
@Deprecated public void clearShowHideListners()
clearShowHideListeners()public void clearShowHideListeners()
ColumnShowHideListeners of this column except the permanent listenerspublic boolean isHidden()
public boolean isPluginColumn()
public ColumnConfig<T> setPluginColumn(boolean pluginColumn)
pluginColumn - boolean, true if the column is being registered by a plugin, else falsepublic String getSortKey()
public FlexLayout getHeaderLayout()
FlexLayout of the column headerpublic final boolean isUtilityColumn()
public boolean isDrawTitle()
public ColumnConfig<T> setDrawTitle(boolean drawTitle)
drawTitle - booleanCopyright © 2019–2022 Dominokit. All rights reserved.