Package io.jmix.ui.component
Interface DataGrid<E>
- Type Parameters:
E- row item type
- All Superinterfaces:
ActionsHolder,Component,Component.BelongToFrame,Component.Focusable,Component.HasCaption,Component.HasDescription,Component.HasIcon,HasButtonsPanel,HasContextHelp,HasHtmlCaption,HasHtmlDescription,HasHtmlSanitizer,HasMinSize,HasPagination,HasSubParts,ListComponent<E>,LookupComponent<E>
- All Known Subinterfaces:
TreeDataGrid<E>
- All Known Implementing Classes:
AbstractDataGrid,DataGridImpl,TreeDataGridImpl
@StudioComponent(caption="DataGrid",
category="Components",
xmlElement="dataGrid",
icon="io/jmix/ui/icon/component/dataGrid.svg",
canvasBehaviour=TABLE,
documentationURL="https://docs.jmix.io/jmix/%VERSION%/ui/vcl/components/data-grid.html")
public interface DataGrid<E>
extends ListComponent<E>, HasButtonsPanel, Component.HasCaption, Component.HasIcon, HasContextHelp, HasHtmlCaption, HasHtmlDescription, LookupComponent<E>, Component.Focusable, HasSubParts, HasHtmlSanitizer, HasPagination, HasMinSize
A grid component for displaying tabular data bound to entity type.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classThe root class from which all DataGrid editor event state objects shall be derived.static classThe root class from which all DataGrid event state objects shall be derived.static enumDefines the position of aggregation row.static interfaceA Renderer that displays a button with a textual caption.static interfaceA renderer that represents a boolean values as a graphical check box icons.static interfaceA renderer for presenting simple plain-text string values as a link with call back handler.static interfaceA column in the DataGrid.static classAn event that is fired when a column's collapsing changes.static classEvent provided by a column generatorstatic classAn event that is fired when the columns are reordered.static classAn event that is fired when a column is resized.static enumstatic interfaceA renderer for UI components.static classContext click event fired by aDataGrid.static classClass for holding information about a mouse click event.static enumEnumeration, specifying the content type of a Cell in a DataGrid header or footer.static interfaceA renderer for presenting date values.static classAn event that is fired when the DataGrid editor is closed.static classclass which stores information that can be used when creating a component for aDataGrideditor.static classAn event that is fired before the DataGrid editor is opened.static classAn event that is fired after the item is updated.static classAn event that is fired before the item is updated.static classDescribes empty state link click event.static interfaceRepresents a footer cell in DataGrid.static interfaceRepresents a footer row in DataGrid.static interfaceA renderer has a DateTimeFormatter.static interfaceA renderer has a format string.static interfaceA renderer has a locale.static interfaceA renderer has a null representation.static interfaceRenderer has click listener.static interfaceRepresents a header cell in DataGrid.static interfaceRepresents a header row in DataGrid.static interfaceA renderer for presenting HTML content.static interfaceA renderer that representsJmixIcon.static interfaceA renderer for presenting images.static classClick event fired by aDataGridstatic interfaceA renderer for presenting LocalDate values.static interfaceA renderer for presenting LocalDateTime values.static interfaceA renderer for presenting number values.static interfaceA renderer that represents a double values as a graphical progress bar.static interfaceMarker interface to indicate that the implementing class can be used as a renderer.static classClick event fired by aDataGrid.HasRendererClickListenerstatic enumEnumeration, specifying the destinations that are supported when scrolling rows or columns into view.static classEvent sent when the selection changes.static enumstatic enumDescribes sorting direction.static classAn event that is fired when a sort order is changed.static classSort order descriptor.static interfaceBase interface for DataGrid header or footer cells.static interfaceDataGrid.StaticRow<T extends DataGrid.StaticCell>Base interface for DataGrid header and footer rows.static interfaceA renderer for presenting simple plain-text string values.Nested classes/interfaces inherited from interface io.jmix.ui.component.Component
Component.Alignment, Component.BelongToFrame, Component.Disposable, Component.Editable, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, Component.HasXmlDescriptor, Component.WrapperNested classes/interfaces inherited from interface io.jmix.ui.component.HasContextHelp
HasContextHelp.ContextHelpIconClickEventNested classes/interfaces inherited from interface io.jmix.ui.component.LookupComponent
LookupComponent.LookupSelectionChangeEvent<T>, LookupComponent.LookupSelectionChangeNotifier<T> -
Field Summary
FieldsFields inherited from interface io.jmix.ui.component.Component
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE -
Method Summary
Modifier and TypeMethodDescriptionvoidaddColumn(DataGrid.Column<E> column) Adds the given column to DataGrid.voidaddColumn(DataGrid.Column<E> column, int index) Adds the given column at the specified index to DataGrid.addColumn(String id, MetaPropertyPath propertyPath) Creates new column with given Id and property, then adds this column to DataGrid.addColumn(String id, MetaPropertyPath propertyPath, int index) Creates new column with given Id and property at the specified index, then adds this column to DataGrid.Registers a new column collapsing change listener.Registers a new column reorder listener.Registers a new column resize listener.Registers a new context click listeneraddEditorCloseListener(Consumer<DataGrid.EditorCloseEvent<E>> listener) Registers a new DataGrid editor close listener.addEditorOpenListener(Consumer<DataGrid.EditorOpenEvent<E>> listener) Registers a new DataGrid editor open listener.Registers a new DataGrid editor post commit listener.Registers a new DataGrid editor pre commit listener.addFooterRowAt(int index) Inserts a new row at the given position to the footer section.addGeneratedColumn(String columnId, Function<DataGrid.ColumnGeneratorEvent<E>, ?> generator) Add a generated column to the DataGrid.addGeneratedColumn(String columnId, Function<DataGrid.ColumnGeneratorEvent<E>, ?> generator, int index) Add a generated column to the DataGrid.addHeaderRowAt(int index) Inserts a new row at the given position to the header section.addItemClickListener(Consumer<DataGrid.ItemClickEvent<E>> listener) Registers a new item click listenervoidaddRowStyleProvider(Function<? super E, String> styleProvider) Adds style provider for the DataGrid rows.addSelectionListener(Consumer<DataGrid.SelectionEvent<E>> listener) Registers a new selection listeneraddSortListener(Consumer<DataGrid.SortEvent> listener) Registers a new sort order change listenerAdds a new row at the bottom of the footer section.Adds a new row at the bottom of the header section.voidCloses editor if it's opened.voidDeselects the given item.voidDeselects all the items in the current data source.voidOpens the editor interface for the provided entity.doubleReturns the current body row height.Returns a column based on the Id.getColumnGenerator(String columnId) Gets the columns generator for the given column id.getColumnNN(String id) Returns a column by its Id.Returns the current column resize mode.Returns a copy of currently configured columns in their current visual order in this DataGrid.Returns the current default row of the header section.Returns the item that is currently being edited.Gets the current caption of the cancel button in the DataGrid editor.Gets the current caption of the save button in the DataGrid editor.getFooterRow(int index) Gets the footer row at given index.intGets the row count for the footer.doubleReturns the current footer row height.intGets the number of frozen columns in this DataGrid.getHeaderRow(int index) Gets the header row at given index.intGets the row count for the header section.doubleReturns the current header row height.getItems()Returns theRowDescriptionProviderinstance used to generate descriptions (tooltips) for DataGrid rowsdefault ObjectgetSubPart(String name) Returns a copy of columns not hidden by security permissions.booleanbooleanReturns whether column reordering is allowed.booleanbooleanbooleanisDetailsVisible(E entity) Checks whether details are visible for the given item.booleanReturns whether an item is currently being edited in the editor.booleanGets the buffered editor mode.booleanbooleanChecks whether the item editor UI is enabled for this DataGrid.booleanReturns the visibility of the footer section.booleanReturns the visibility of the header section.booleanbooleanstatic <T> org.springframework.core.ParameterizedTypeReference<DataGrid<T>>Adds a new row at the top of the footer section.Adds a new row at the top of the header section.voidremoveColumn(DataGrid.Column<E> column) Removes the given column from DataGrid or do nothing if column isnull.voidremoveColumn(String id) Removes a column from DataGrid by its Id or do nothing if column is not found.voidremoveFooterRow(int index) Removes the row at the given position from the footer section.voidremoveFooterRow(DataGrid.FooterRow footerRow) Removes the given row from the footer section.voidremoveHeaderRow(int index) Removes the row at the given position from the header section.voidremoveHeaderRow(DataGrid.HeaderRow headerRow) Removes the given row from the header section.voidremoveRowStyleProvider(Function<? super E, String> styleProvider) Removes style provider for the DataGrid rows.voidrepaint()Repaint UI representation of the DataGrid without refreshing the table data.voidScrolls to a certain item, usingDataGrid.ScrollDestination.ANY.voidscrollTo(E item, DataGrid.ScrollDestination destination) Scrolls to a certain item, using user-specified scroll destination.voidScrolls to the last data item.voidScrolls to the first data item.voidMarks all the items in the current data source as selected.voidsetAggregatable(boolean aggregatable) Set to true if aggregation should be enabled.voidSets aggregation row position.voidsetBodyRowHeight(double rowHeight) Sets the height of a body row.voidsetColumnReorderingAllowed(boolean columnReorderingAllowed) Sets whether or not column reordering is allowed.voidSets the column resize mode to use.voidsetColumnsCollapsingAllowed(boolean columnsCollapsingAllowed) Defines if collapsible attribute can be changed for individual column or not.voidsetContextMenuEnabled(boolean contextMenuEnabled) Sets whether or not context menu is enabled.voidsetDefaultHeaderRow(DataGrid.HeaderRow headerRow) Sets the default row of the header.voidsetDetailsGenerator(Function<E, Component> detailsGenerator) Sets a new details generator for row details.voidsetDetailsVisible(E entity, boolean visible) Shows or hides the details for a specific item.voidsetEditorBuffered(boolean editorBuffered) Sets the buffered editor mode.voidsetEditorCancelCaption(String cancelCaption) Sets the caption on the cancel button in the DataGrid editor.voidsetEditorCrossFieldValidate(boolean validate) Enables cross field validation in the inline editor.voidsetEditorEnabled(boolean isEnabled) Sets whether or not the item editor UI is enabled for this DataGrid.voidsetEditorSaveCaption(String saveCaption) Sets the caption on the save button in the DataGrid editor.voidSets click handler for link message.voidsetEmptyStateLinkMessage(String linkMessage) Sets a link message to the middle of DataGrid body that should be appeared when DataGrid is empty.voidsetEmptyStateMessage(String message) Sets a message to the middle of DataGrid body that should be appeared when DataGrid is empty.voidsetEnterPressAction(Action action) Assigns an action to be executed on Enter key press.voidsetFooterRowHeight(double rowHeight) Sets the body of a footer row.voidsetFooterVisible(boolean footerVisible) Sets the visibility of the footer section.voidsetFrozenColumnCount(int numberOfColumns) Sets the number of frozen columns in this grid.voidsetHeaderRowHeight(double rowHeight) Sets the body of a body row.voidsetHeaderVisible(boolean headerVisible) Sets the visibility of the header section.voidsetItemClickAction(Action action) Assigns an action to be executed on double click on a DataGrid row.voidsetItems(DataGridItems<E> dataGridItems) Sets an instance ofDataGridItemsas the DataGrid data source.voidsetMinHeight(String minHeight) SetsminHeightCSS property value to the Grid (not a composition).voidsetMinWidth(String minWidth) SetsminWidthCSS property value to the Grid (not a composition).voidsetRowDescriptionProvider(Function<? super E, String> provider) Sets theRowDescriptionProviderinstance for generating optional descriptions (tooltips) for DataGrid rows.voidsetRowDescriptionProvider(Function<? super E, String> provider, ContentMode contentMode) Sets theRowDescriptionProviderinstance for generating optional descriptions (tooltips) for DataGrid rows.voidsetSelectionMode(DataGrid.SelectionMode selectionMode) Sets the DataGrid's selection mode.voidsetSortable(boolean sortable) Defines if this attribute can be changed for individual column or not.voidsetTextSelectionEnabled(boolean textSelectionEnabled) Enable or disable text selection in DataGrid cells.voidsort(String columnId, DataGrid.SortDirection direction) Sorts the DataGrid data for passed column id in the chosen sort direction.Methods inherited from interface io.jmix.ui.component.ActionsHolder
addAction, addAction, getAction, getActionNN, getActions, removeAction, removeAction, removeAllActionsMethods inherited from interface io.jmix.ui.component.Component
addStyleName, getAlignment, getHeight, getHeightSizeUnit, getId, getParent, getStyleName, getWidth, getWidthSizeUnit, isEnabled, isEnabledRecursive, isResponsive, isVisible, isVisibleRecursive, removeStyleName, setAlignment, setEnabled, setHeight, setHeightAuto, setHeightFull, setId, setParent, setResponsive, setSizeAuto, setSizeFull, setStyleName, setVisible, setWidth, setWidthAuto, setWidthFull, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, withUnwrapped, withUnwrappedCompositionMethods inherited from interface io.jmix.ui.component.Component.BelongToFrame
getFrame, setFrameMethods inherited from interface io.jmix.ui.component.Component.Focusable
focus, getTabIndex, isFocusable, setFocusable, setTabIndexMethods inherited from interface io.jmix.ui.component.Component.HasCaption
getCaption, setCaptionMethods inherited from interface io.jmix.ui.component.Component.HasDescription
getDescription, setDescriptionMethods inherited from interface io.jmix.ui.component.Component.HasIcon
getIcon, setIcon, setIconFromSetMethods inherited from interface io.jmix.ui.component.HasButtonsPanel
getButtonsPanel, setButtonsPanelMethods inherited from interface io.jmix.ui.component.HasContextHelp
getContextHelpIconClickHandler, getContextHelpText, isContextHelpTextHtmlEnabled, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabledMethods inherited from interface io.jmix.ui.component.HasHtmlCaption
isCaptionAsHtml, setCaptionAsHtmlMethods inherited from interface io.jmix.ui.component.HasHtmlDescription
isDescriptionAsHtml, setDescriptionAsHtmlMethods inherited from interface io.jmix.ui.component.HasHtmlSanitizer
isHtmlSanitizerEnabled, setHtmlSanitizerEnabledMethods inherited from interface io.jmix.ui.component.HasPagination
getPagination, setPaginationMethods inherited from interface io.jmix.ui.component.ListComponent
getSelected, getSingleSelected, isMultiSelect, setSelected, setSelectedMethods inherited from interface io.jmix.ui.component.LookupComponent
getLookupSelectedItems, setLookupSelectHandler
-
Field Details
-
NAME
- See Also:
-
-
Method Details
-
of
-
getColumns
@StudioElementsGroup(xmlElement="columns", caption="Columns", icon="io/jmix/ui/icon/element/columns.svg") List<DataGrid.Column<E>> getColumns()Returns a copy of currently configured columns in their current visual order in this DataGrid.- Returns:
- unmodifiable copy of current columns
- See Also:
-
getVisibleColumns
List<DataGrid.Column<E>> getVisibleColumns()Returns a copy of columns not hidden by security permissions.- Returns:
- copy of columns not hidden by security permissions
- See Also:
-
getColumn
Returns a column based on the Id.- Parameters:
id- the column Id- Returns:
- the column or
nullif not found - See Also:
-
getColumnNN
Returns a column by its Id.- Parameters:
id- the column Id- Returns:
- the column with given Id
- Throws:
IllegalStateException- if not found- See Also:
-
addColumn
Adds the given column to DataGrid.- Parameters:
column- the column to add- See Also:
-
addColumn
Adds the given column at the specified index to DataGrid.- Parameters:
column- the column to addindex- index of a new column- See Also:
-
addColumn
Creates new column with given Id and property, then adds this column to DataGrid.- Parameters:
id- the column IdpropertyPath- the instance ofMetaPropertyPathrepresenting a relative path to a property from certain MetaClass- Returns:
- the newly created column
- See Also:
-
addColumn
Creates new column with given Id and property at the specified index, then adds this column to DataGrid.- Parameters:
id- the column IdpropertyPath- the instance ofMetaPropertyPathrepresenting a relative path to a property from certain MetaClassindex- index of a new column- Returns:
- the newly created column
- See Also:
-
removeColumn
Removes the given column from DataGrid or do nothing if column isnull.- Parameters:
column- the column to add- See Also:
-
removeColumn
Removes a column from DataGrid by its Id or do nothing if column is not found.- Parameters:
id- the columns Id- See Also:
-
getItems
- Specified by:
getItemsin interfaceListComponent<E>- Returns:
- The DataGrid source
-
setItems
Sets an instance ofDataGridItemsas the DataGrid data source.- Parameters:
dataGridItems- the DataGrid data source
-
selectAll
void selectAll()Marks all the items in the current data source as selected. -
deselect
Deselects the given item. If the item is not currently selected, does nothing.- Parameters:
item- the item to deselect, not null
-
deselectAll
void deselectAll()Deselects all the items in the current data source. -
sort
Sorts the DataGrid data for passed column id in the chosen sort direction.- Parameters:
columnId- id of the column to sortdirection- sort direction
-
getSortOrder
List<DataGrid.SortOrder> getSortOrder()- Returns:
- sort order list
-
isTextSelectionEnabled
boolean isTextSelectionEnabled()- Returns:
trueif text selection is enabled.
-
setTextSelectionEnabled
Enable or disable text selection in DataGrid cells. Default value isfalse.- Parameters:
textSelectionEnabled- specifies whether text selection in DataGrid cells is enabled
-
isColumnReorderingAllowed
boolean isColumnReorderingAllowed()Returns whether column reordering is allowed. Default value istrue.- Returns:
trueif reordering is allowed
-
setColumnReorderingAllowed
@StudioProperty(name="reorderingAllowed", defaultValue="true") void setColumnReorderingAllowed(boolean columnReorderingAllowed) Sets whether or not column reordering is allowed. Default value istrue.- Parameters:
columnReorderingAllowed- specifies whether column reordering is allowed
-
isHeaderVisible
boolean isHeaderVisible()Returns the visibility of the header section.- Returns:
trueif visible,falseotherwise
-
setHeaderVisible
Sets the visibility of the header section.- Parameters:
headerVisible-trueto show the header section,falseto hide
-
getBodyRowHeight
double getBodyRowHeight()Returns the current body row height.- Returns:
- body row height, -1 if height is AUTO
-
setBodyRowHeight
@StudioProperty(name="bodyRowHeight", defaultValue="-1.0") @Min(-1L) void setBodyRowHeight(double rowHeight) Sets the height of a body row. If -1 (default), the row height is calculated based on the theme for an empty row before the DataGrid is displayed.- Parameters:
rowHeight- the height of a row in pixels or -1 for AUTO
-
getHeaderRowHeight
double getHeaderRowHeight()Returns the current header row height.- Returns:
- header row height, -1 if height is AUTO
-
setHeaderRowHeight
@StudioProperty(name="headerRowHeight", defaultValue="-1.0") @Min(-1L) void setHeaderRowHeight(double rowHeight) Sets the body of a body row. If -1 (default), the row height is calculated based on the theme for an empty row before the DataGrid is displayed.- Parameters:
rowHeight- the height of a row in pixels or -1 for AUTO
-
isContextMenuEnabled
boolean isContextMenuEnabled()- Returns:
trueif context menu is enabled,falseotherwise
-
setContextMenuEnabled
void setContextMenuEnabled(boolean contextMenuEnabled) Sets whether or not context menu is enabled. Default value istrue.- Parameters:
contextMenuEnabled- specifies whether context menu is enabled
-
getItemClickAction
- Returns:
- an action to be executed on double click on a DataGrid row,
assigned by
setItemClickAction(Action) - See Also:
-
setItemClickAction
Assigns an action to be executed on double click on a DataGrid row.If such action is not set, the table responds to pressing Enter by trying to find and execute the following actions:
- action, assigned to Enter key press by setting its
shortcutproperty - action named "edit"
- action named "view"
If one of these actions is found and it is enabled, it is executed.
- Parameters:
action- an action to be executed on double click on a DataGrid row
- action, assigned to Enter key press by setting its
-
getEnterPressAction
- Returns:
- an action to be executed on Enter key press, assigned by
setEnterPressAction(Action) - See Also:
-
setEnterPressAction
Assigns an action to be executed on Enter key press.If such action is not set, the table responds to pressing Enter by trying to find and execute the following actions:
- action, assigned by
setItemClickAction(Action) - action, assigned to Enter key press by setting its
shortcutproperty - action named "edit"
- action named "view"
If one of these actions is found and it is enabled, it is executed.
- Parameters:
action- an action to be executed on Enter key press- See Also:
- action, assigned by
-
getFrozenColumnCount
int getFrozenColumnCount()Gets the number of frozen columns in this DataGrid. 0 means that no data columns will be frozen, but the built-in selection checkbox column will still be frozen if it's in use. -1 means that not even the selection column is frozen. NOTE: this count includeshidden columnsin the count.- Returns:
- the number of frozen columns
- See Also:
-
setFrozenColumnCount
@StudioProperty(name="frozenColumnCount", defaultValue="0") @Min(-1L) void setFrozenColumnCount(int numberOfColumns) Sets the number of frozen columns in this grid. Setting the count to 0 means that no data columns will be frozen, but the built-in selection checkbox column will still be frozen if it's in use. Setting the count to -1 will also disable the selection column.The default value is 0.
- Parameters:
numberOfColumns- the number of columns that should be frozen- Throws:
IllegalArgumentException- if the column count is < 0 or > the number of visible columns
-
isSortable
boolean isSortable()- Returns:
trueif individual column sortable attribute can be set totrue,falseotherwise
-
setSortable
Defines if this attribute can be changed for individual column or not. Default value istrue.- Parameters:
sortable-trueif individual column sortable attribute can be set totrue,falseotherwise
-
isColumnsCollapsingAllowed
boolean isColumnsCollapsingAllowed()- Returns:
trueif individual column collapsible attribute can be set totrue,falseotherwise
-
setColumnsCollapsingAllowed
@StudioProperty(defaultValue="true") void setColumnsCollapsingAllowed(boolean columnsCollapsingAllowed) Defines if collapsible attribute can be changed for individual column or not. Default value istrue.- Parameters:
columnsCollapsingAllowed-trueif individual column collapsible attribute can be set totrue,falseotherwise
-
isEditorEnabled
boolean isEditorEnabled()Checks whether the item editor UI is enabled for this DataGrid.- Returns:
trueif the editor is enabled for this grid- See Also:
-
setEditorEnabled
Sets whether or not the item editor UI is enabled for this DataGrid. When the editor is enabled, the user can open it by double-clicking a row or hitting enter when a row is focused. The editor can also be opened programmatically using theedit(Object)method.- Parameters:
isEnabled-trueto enable the feature,falseotherwise- See Also:
-
isEditorBuffered
boolean isEditorBuffered()Gets the buffered editor mode.- Returns:
trueif buffered editor is enabled,falseotherwise
-
setEditorBuffered
Sets the buffered editor mode. The default mode is buffered (true).- Parameters:
editorBuffered-trueto enable buffered editor,falseto disable it
-
getEditorSaveCaption
String getEditorSaveCaption()Gets the current caption of the save button in the DataGrid editor.- Returns:
- the current caption of the save button
-
setEditorSaveCaption
Sets the caption on the save button in the DataGrid editor.- Parameters:
saveCaption- the caption to set
-
getEditorCancelCaption
String getEditorCancelCaption()Gets the current caption of the cancel button in the DataGrid editor.- Returns:
- the current caption of the cancel button
-
setEditorCancelCaption
Sets the caption on the cancel button in the DataGrid editor.- Parameters:
cancelCaption- the caption to set
-
getEditedItem
Returns the item that is currently being edited.- Returns:
- the item that is currently being edited, or
nullif no item is being edited at the moment
-
isEditorActive
boolean isEditorActive()Returns whether an item is currently being edited in the editor.- Returns:
trueif the editor is open
-
closeEditor
void closeEditor()Closes editor if it's opened. -
edit
Opens the editor interface for the provided entity. Scrolls the Grid to bring the entity to view if it is not already visible.- Parameters:
item- the item to edit- Throws:
IllegalStateException- if the editor is not enabled or already editing an entity in buffered modeIllegalArgumentException- if datasource doesn't contain the entity- See Also:
-
setEditorCrossFieldValidate
@StudioProperty(name="editorCrossFieldValidate", defaultValue="true") void setEditorCrossFieldValidate(boolean validate) Enables cross field validation in the inline editor. True by default.- Parameters:
validate- validate option, true if an editor should validate cross field rules
-
isEditorCrossFieldValidate
boolean isEditorCrossFieldValidate()- Returns:
- true if editor validates cross field rules
-
addEditorPreCommitListener
Registers a new DataGrid editor pre commit listener. Works in buffered mode only.- Parameters:
listener- the listener to register
-
addEditorPostCommitListener
Registers a new DataGrid editor post commit listener. Works in buffered mode only.- Parameters:
listener- the listener to register
-
addEditorCloseListener
Registers a new DataGrid editor close listener.- Parameters:
listener- the listener to register
-
addEditorOpenListener
Registers a new DataGrid editor open listener.- Parameters:
listener- the listener to register
-
repaint
void repaint()Repaint UI representation of the DataGrid without refreshing the table data. -
scrollTo
Scrolls to a certain item, usingDataGrid.ScrollDestination.ANY.- Parameters:
item- item to scroll to- See Also:
-
scrollTo
Scrolls to a certain item, using user-specified scroll destination.- Parameters:
item- item to scroll todestination- value specifying desired position of scrolled-to row- See Also:
-
scrollToStart
void scrollToStart()Scrolls to the first data item. -
scrollToEnd
void scrollToEnd()Scrolls to the last data item. -
getColumnResizeMode
DataGrid.ColumnResizeMode getColumnResizeMode()Returns the current column resize mode. The default mode isDataGrid.ColumnResizeMode.ANIMATED.- Returns:
- a ColumnResizeMode value
-
setColumnResizeMode
@StudioProperty(type=ENUMERATION, defaultValue="ANIMATED", options={"ANIMATED","SIMPLE"}) void setColumnResizeMode(DataGrid.ColumnResizeMode mode) Sets the column resize mode to use. The default mode isDataGrid.ColumnResizeMode.ANIMATED.- Parameters:
mode- a ColumnResizeMode value
-
getSelectionMode
DataGrid.SelectionMode getSelectionMode()- Returns:
- the currently used
DataGrid.SelectionMode
-
setSelectionMode
@StudioProperty(type=ENUMERATION, defaultValue="SINGLE", options={"SINGLE","MULTI","MULTI_CHECK","NONE"}) void setSelectionMode(DataGrid.SelectionMode selectionMode) Sets the DataGrid's selection mode.- Parameters:
selectionMode- the selection mode to use
-
addRowStyleProvider
Adds style provider for the DataGrid rows.DataGrid can use several providers to obtain many style names for rows.
- Parameters:
styleProvider- a style provider to add, not null
-
removeRowStyleProvider
Removes style provider for the DataGrid rows.- Parameters:
styleProvider- a style provider to remove, not null
-
getRowDescriptionProvider
Returns theRowDescriptionProviderinstance used to generate descriptions (tooltips) for DataGrid rows- Returns:
- the description provider or null if no provider is set
-
setRowDescriptionProvider
Sets theRowDescriptionProviderinstance for generating optional descriptions (tooltips) for DataGrid rows. If aDataGrid.Column.setDescriptionProvider(Function)is also set, the row description generated byprovideris used for cells for which the cell description provider returns null.This method uses the
ContentMode.PREFORMATTEDcontent mode.- Parameters:
provider- the description provider to use ornullto remove a previously set provider if any
-
setRowDescriptionProvider
void setRowDescriptionProvider(@Nullable Function<? super E, String> provider, ContentMode contentMode) Sets theRowDescriptionProviderinstance for generating optional descriptions (tooltips) for DataGrid rows. If aDataGrid.Column.setDescriptionProvider(Function)is also set, the row description generated byprovideris used for cells for which the cell description provider returns null.- Parameters:
provider- the description provider to use ornullto remove a previously set provider if anycontentMode- the content mode for row tooltips
-
addGeneratedColumn
DataGrid.Column<E> addGeneratedColumn(String columnId, Function<DataGrid.ColumnGeneratorEvent<E>, ?> generator) Add a generated column to the DataGrid.- Parameters:
columnId- column identifier as defined in XML descriptorgenerator- column generator instance- See Also:
-
addGeneratedColumn
DataGrid.Column<E> addGeneratedColumn(String columnId, Function<DataGrid.ColumnGeneratorEvent<E>, ?> generator, int index) Add a generated column to the DataGrid.- Parameters:
columnId- column identifier as defined in XML descriptorgenerator- column generator instanceindex- index of a new generated column- See Also:
-
getColumnGenerator
Gets the columns generator for the given column id.- Parameters:
columnId- the column id for which to return column generator- Returns:
- the column generator for given column id
-
getDetailsGenerator
- Returns:
- the current details generator for row details or
nullif not set
-
setDetailsGenerator
Sets a new details generator for row details.The currently opened row details will be re-rendered.
- Parameters:
detailsGenerator- the details generator to set
-
isDetailsVisible
Checks whether details are visible for the given item.- Parameters:
entity- the item for which to check details visibility- Returns:
trueif the details are visible
-
setDetailsVisible
Shows or hides the details for a specific item.- Parameters:
entity- the item for which to set details visibilityvisible-trueto show the details, orfalseto hide them
-
addColumnCollapsingChangeListener
Subscription addColumnCollapsingChangeListener(Consumer<DataGrid.ColumnCollapsingChangeEvent> listener) Registers a new column collapsing change listener.- Parameters:
listener- the listener to register
-
addColumnReorderListener
Registers a new column reorder listener.- Parameters:
listener- the listener to register
-
addColumnResizeListener
Registers a new column resize listener.- Parameters:
listener- the listener to register
-
addSelectionListener
Registers a new selection listener- Parameters:
listener- the listener to register
-
addSortListener
Registers a new sort order change listener- Parameters:
listener- the listener to register
-
addContextClickListener
Registers a new context click listener- Parameters:
listener- the listener to register
-
addItemClickListener
Registers a new item click listener- Parameters:
listener- the listener to register
-
getHeaderRow
Gets the header row at given index.- Parameters:
index- 0 based index for row. Counted from top to bottom- Returns:
- header row at given index
-
appendHeaderRow
DataGrid.HeaderRow appendHeaderRow()Adds a new row at the bottom of the header section.- Returns:
- the new row
- See Also:
-
prependHeaderRow
DataGrid.HeaderRow prependHeaderRow()Adds a new row at the top of the header section.- Returns:
- the new row
- See Also:
-
addHeaderRowAt
Inserts a new row at the given position to the header section. Shifts the row currently at that position and any subsequent rows down (adds one to their indices).- Parameters:
index- the position at which to insert the row- Returns:
- the new row
- See Also:
-
removeHeaderRow
Removes the given row from the header section.- Parameters:
headerRow- the row to be removed- See Also:
-
removeHeaderRow
void removeHeaderRow(int index) Removes the row at the given position from the header section.- Parameters:
index- the position of the row- See Also:
-
getDefaultHeaderRow
Returns the current default row of the header section. The default row is a special header row providing a user interface for sorting columns. Setting a header text for column updates cells in the default header.- Returns:
- the default row or null if no default row set
-
setDefaultHeaderRow
Sets the default row of the header. The default row is a special header row providing a user interface for sorting columns.- Parameters:
headerRow- the new default row, or null for no default row
-
getHeaderRowCount
int getHeaderRowCount()Gets the row count for the header section.- Returns:
- row count
-
getSubPart
- Specified by:
getSubPartin interfaceActionsHolder- Specified by:
getSubPartin interfaceHasSubParts
-
isAggregatable
boolean isAggregatable()- Returns:
- true if DataGrid is aggregatable
-
setAggregatable
Set to true if aggregation should be enabled. Default value is false.- Parameters:
aggregatable- aggregatable option
-
getAggregationPosition
DataGrid.AggregationPosition getAggregationPosition()- Returns:
- return aggregation row position
-
setAggregationPosition
@StudioProperty(type=ENUMERATION, defaultValue="TOP", options={"TOP","BOTTOM"}) void setAggregationPosition(DataGrid.AggregationPosition position) Sets aggregation row position. Default value isDataGrid.AggregationPosition.TOP.- Parameters:
position- position:DataGrid.AggregationPosition.TOPorDataGrid.AggregationPosition.BOTTOM
-
getAggregationResults
- Returns:
- aggregated values for columns
-
setEmptyStateMessage
Sets a message to the middle of DataGrid body that should be appeared when DataGrid is empty.- Parameters:
message- message that appears when DataGrid is empty
-
getEmptyStateMessage
- Returns:
- message that should be appeared when DataGrid is empty
-
setEmptyStateLinkMessage
Sets a link message to the middle of DataGrid body that should be appeared when DataGrid is empty.- Parameters:
linkMessage- message that appears when DataGrid is empty- See Also:
-
getEmptyStateLinkMessage
- Returns:
- link message that should be appeared when DataGrid is empty
-
setEmptyStateLinkClickHandler
Sets click handler for link message. Link message can be shown when DataGrid is empty.- Parameters:
handler- handler to set- See Also:
-
getEmptyStateLinkClickHandler
- Returns:
- click handler for link message
-
getMinHeight
- Specified by:
getMinHeightin interfaceHasMinSize- Returns:
min-heightCSS property value of the Grid (not a composition) ornullif not set
-
getMinHeightSizeUnit
- Specified by:
getMinHeightSizeUnitin interfaceHasMinSize- Returns:
- unit size of
min-heightCSS property value of the Grid (not a composition)
-
setMinHeight
SetsminHeightCSS property value to the Grid (not a composition). To set CSS properties to the composition usecssattribute in the XML descriptor orHtmlAttributes.applyCss(Component, String).- Specified by:
setMinHeightin interfaceHasMinSize- Parameters:
minHeight- property value
-
getMinWidth
- Specified by:
getMinWidthin interfaceHasMinSize- Returns:
min-widthCSS property value of the Grid (not a composition) ornullif not set
-
getMinWidthSizeUnit
- Specified by:
getMinWidthSizeUnitin interfaceHasMinSize- Returns:
- unit size of
min-widthCSS property value of the Grid (not a composition)
-
setMinWidth
SetsminWidthCSS property value to the Grid (not a composition). To set CSS properties to the composition usecssattribute in the XML descriptor orHtmlAttributes.applyCss(Component, String).- Specified by:
setMinWidthin interfaceHasMinSize- Parameters:
minWidth- property value
-