E - row item type@StudioComponent(caption="DataGrid", category="Components", xmlElement="dataGrid", icon="io/jmix/ui/icon/component/dataGrid.svg", canvasBehaviour=TABLE, documentationURL="https://docs.jmix.io/jmix/%VERSION%/backoffice-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
| Modifier and Type | Interface and Description |
|---|---|
static class |
DataGrid.AbstractDataGridEditorEvent<E>
The root class from which all DataGrid editor event state objects shall be derived.
|
static class |
DataGrid.AbstractDataGridEvent
The root class from which all DataGrid event state objects shall be derived.
|
static class |
DataGrid.AggregationPosition
Defines the position of aggregation row.
|
static interface |
DataGrid.ButtonRenderer<T>
A Renderer that displays a button with a textual caption.
|
static interface |
DataGrid.CheckBoxRenderer
A renderer that represents a boolean values as a graphical check box icons.
|
static interface |
DataGrid.ClickableTextRenderer<T>
A renderer for presenting simple plain-text string values as a link with call back handler.
|
static interface |
DataGrid.Column<E>
A column in the DataGrid.
|
static class |
DataGrid.ColumnCollapsingChangeEvent
An event that is fired when a column's collapsing changes.
|
static class |
DataGrid.ColumnGeneratorEvent<E>
Event provided by a column generator
|
static class |
DataGrid.ColumnReorderEvent
An event that is fired when the columns are reordered.
|
static class |
DataGrid.ColumnResizeEvent
An event that is fired when a column is resized.
|
static class |
DataGrid.ColumnResizeMode |
static interface |
DataGrid.ComponentRenderer
A renderer for UI components.
|
static class |
DataGrid.ContextClickEvent
Context click event fired by a
DataGrid. |
static class |
DataGrid.DataGridClickEvent
Class for holding information about a mouse click event.
|
static class |
DataGrid.DataGridStaticCellType
Enumeration, specifying the content type of a Cell in a DataGrid header or footer.
|
static interface |
DataGrid.DateRenderer
A renderer for presenting date values.
|
static class |
DataGrid.EditorCloseEvent<E>
An event that is fired when the DataGrid editor is closed.
|
static class |
DataGrid.EditorFieldGenerationContext<T>
class which stores information that can be used
when creating a component for a
DataGrid editor. |
static class |
DataGrid.EditorOpenEvent<E>
An event that is fired before the DataGrid editor is opened.
|
static class |
DataGrid.EditorPostCommitEvent<E>
An event that is fired after the item is updated.
|
static class |
DataGrid.EditorPreCommitEvent<E>
An event that is fired before the item is updated.
|
static class |
DataGrid.EmptyStateClickEvent<E>
Describes empty state link click event.
|
static interface |
DataGrid.FooterCell
Represents a footer cell in DataGrid.
|
static interface |
DataGrid.FooterRow
Represents a footer row in DataGrid.
|
static interface |
DataGrid.HasDateTimeFormatter
A renderer has a DateTimeFormatter.
|
static interface |
DataGrid.HasFormatString
A renderer has a format string.
|
static interface |
DataGrid.HasLocale
A renderer has a locale.
|
static interface |
DataGrid.HasNullRepresentation
A renderer has a null representation.
|
static interface |
DataGrid.HasRendererClickListener<T>
Renderer has click listener.
|
static interface |
DataGrid.HeaderCell
Represents a header cell in DataGrid.
|
static interface |
DataGrid.HeaderRow
Represents a header row in DataGrid.
|
static interface |
DataGrid.HtmlRenderer
A renderer for presenting HTML content.
|
static interface |
DataGrid.IconRenderer<T>
A renderer that represents
JmixIcon. |
static interface |
DataGrid.ImageRenderer<T>
A renderer for presenting images.
|
static class |
DataGrid.ItemClickEvent<E>
Click event fired by a
DataGrid |
static interface |
DataGrid.LocalDateRenderer
A renderer for presenting LocalDate values.
|
static interface |
DataGrid.LocalDateTimeRenderer
A renderer for presenting LocalDateTime values.
|
static interface |
DataGrid.NumberRenderer
A renderer for presenting number values.
|
static interface |
DataGrid.ProgressBarRenderer
A renderer that represents a double values as a graphical progress bar.
|
static interface |
DataGrid.Renderer
Marker interface to indicate that the implementing class can be used as a renderer.
|
static class |
DataGrid.RendererClickEvent<T>
Click event fired by a
DataGrid.HasRendererClickListener |
static class |
DataGrid.ScrollDestination
Enumeration, specifying the destinations that are supported when scrolling
rows or columns into view.
|
static class |
DataGrid.SelectionEvent<E>
Event sent when the selection changes.
|
static class |
DataGrid.SelectionMode |
static class |
DataGrid.SortDirection
Describes sorting direction.
|
static class |
DataGrid.SortEvent
An event that is fired when a sort order is changed.
|
static class |
DataGrid.SortOrder
Sort order descriptor.
|
static interface |
DataGrid.StaticCell
Base interface for DataGrid header or footer cells.
|
static interface |
DataGrid.StaticRow<T extends DataGrid.StaticCell>
Base interface for DataGrid header and footer rows.
|
static interface |
DataGrid.TextRenderer
A renderer for presenting simple plain-text string values.
|
Component.Alignment, Component.BelongToFrame, Component.Disposable, Component.Editable, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, Component.HasXmlDescriptor, Component.WrapperHasContextHelp.ContextHelpIconClickEventLookupComponent.LookupSelectionChangeEvent<T>, LookupComponent.LookupSelectionChangeNotifier<T>| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
NAME |
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE| Modifier and Type | Method and Description |
|---|---|
void |
addColumn(DataGrid.Column<E> column)
Adds the given column to DataGrid.
|
void |
addColumn(DataGrid.Column<E> column,
int index)
Adds the given column at the specified index to DataGrid.
|
DataGrid.Column<E> |
addColumn(java.lang.String id,
io.jmix.core.metamodel.model.MetaPropertyPath propertyPath)
Creates new column with given Id and property, then adds this column to DataGrid.
|
DataGrid.Column<E> |
addColumn(java.lang.String id,
io.jmix.core.metamodel.model.MetaPropertyPath propertyPath,
int index)
Creates new column with given Id and property at the specified index,
then adds this column to DataGrid.
|
io.jmix.core.common.event.Subscription |
addColumnCollapsingChangeListener(java.util.function.Consumer<DataGrid.ColumnCollapsingChangeEvent> listener)
Registers a new column collapsing change listener.
|
io.jmix.core.common.event.Subscription |
addColumnReorderListener(java.util.function.Consumer<DataGrid.ColumnReorderEvent> listener)
Registers a new column reorder listener.
|
io.jmix.core.common.event.Subscription |
addColumnResizeListener(java.util.function.Consumer<DataGrid.ColumnResizeEvent> listener)
Registers a new column resize listener.
|
io.jmix.core.common.event.Subscription |
addContextClickListener(java.util.function.Consumer<DataGrid.ContextClickEvent> listener)
Registers a new context click listener
|
io.jmix.core.common.event.Subscription |
addEditorCloseListener(java.util.function.Consumer<DataGrid.EditorCloseEvent<E>> listener)
Registers a new DataGrid editor close listener.
|
io.jmix.core.common.event.Subscription |
addEditorOpenListener(java.util.function.Consumer<DataGrid.EditorOpenEvent<E>> listener)
Registers a new DataGrid editor open listener.
|
io.jmix.core.common.event.Subscription |
addEditorPostCommitListener(java.util.function.Consumer<DataGrid.EditorPostCommitEvent<E>> listener)
Registers a new DataGrid editor post commit listener.
|
io.jmix.core.common.event.Subscription |
addEditorPreCommitListener(java.util.function.Consumer<DataGrid.EditorPreCommitEvent<E>> listener)
Registers a new DataGrid editor pre commit listener.
|
DataGrid.FooterRow |
addFooterRowAt(int index)
Inserts a new row at the given position to the footer section.
|
DataGrid.Column<E> |
addGeneratedColumn(java.lang.String columnId,
java.util.function.Function<DataGrid.ColumnGeneratorEvent<E>,?> generator)
Add a generated column to the DataGrid.
|
DataGrid.Column<E> |
addGeneratedColumn(java.lang.String columnId,
java.util.function.Function<DataGrid.ColumnGeneratorEvent<E>,?> generator,
int index)
Add a generated column to the DataGrid.
|
DataGrid.HeaderRow |
addHeaderRowAt(int index)
Inserts a new row at the given position to the header section.
|
io.jmix.core.common.event.Subscription |
addItemClickListener(java.util.function.Consumer<DataGrid.ItemClickEvent<E>> listener)
Registers a new item click listener
|
void |
addRowStyleProvider(java.util.function.Function<? super E,java.lang.String> styleProvider)
Adds style provider for the DataGrid rows.
|
io.jmix.core.common.event.Subscription |
addSelectionListener(java.util.function.Consumer<DataGrid.SelectionEvent<E>> listener)
Registers a new selection listener
|
io.jmix.core.common.event.Subscription |
addSortListener(java.util.function.Consumer<DataGrid.SortEvent> listener)
Registers a new sort order change listener
|
DataGrid.FooterRow |
appendFooterRow()
Adds a new row at the bottom of the footer section.
|
DataGrid.HeaderRow |
appendHeaderRow()
Adds a new row at the bottom of the header section.
|
void |
deselect(E item)
Deselects the given item.
|
void |
deselectAll()
Deselects all the items in the current data source.
|
void |
edit(E item)
Opens the editor interface for the provided entity.
|
DataGrid.AggregationPosition |
getAggregationPosition() |
java.util.Map<java.lang.String,java.lang.Object> |
getAggregationResults() |
double |
getBodyRowHeight()
Returns the current body row height.
|
DataGrid.Column<E> |
getColumn(java.lang.String id)
Returns a column based on the Id.
|
java.util.function.Function<DataGrid.ColumnGeneratorEvent<E>,?> |
getColumnGenerator(java.lang.String columnId)
Gets the columns generator for the given column id.
|
DataGrid.Column<E> |
getColumnNN(java.lang.String id)
Returns a column by its Id.
|
DataGrid.ColumnResizeMode |
getColumnResizeMode()
Returns the current column resize mode.
|
java.util.List<DataGrid.Column<E>> |
getColumns()
Returns a copy of currently configured columns in their current visual
order in this DataGrid.
|
DataGrid.HeaderRow |
getDefaultHeaderRow()
Returns the current default row of the header section.
|
java.util.function.Function<E,Component> |
getDetailsGenerator() |
E |
getEditedItem()
Returns the item that is currently being edited.
|
java.lang.String |
getEditorCancelCaption()
Gets the current caption of the cancel button in the DataGrid editor.
|
java.lang.String |
getEditorSaveCaption()
Gets the current caption of the save button in the DataGrid editor.
|
java.util.function.Consumer<DataGrid.EmptyStateClickEvent<E>> |
getEmptyStateLinkClickHandler() |
java.lang.String |
getEmptyStateLinkMessage() |
java.lang.String |
getEmptyStateMessage() |
Action |
getEnterPressAction() |
DataGrid.FooterRow |
getFooterRow(int index)
Gets the footer row at given index.
|
int |
getFooterRowCount()
Gets the row count for the footer.
|
double |
getFooterRowHeight()
Returns the current footer row height.
|
int |
getFrozenColumnCount()
Gets the number of frozen columns in this DataGrid.
|
DataGrid.HeaderRow |
getHeaderRow(int index)
Gets the header row at given index.
|
int |
getHeaderRowCount()
Gets the row count for the header section.
|
double |
getHeaderRowHeight()
Returns the current header row height.
|
Action |
getItemClickAction() |
DataGridItems<E> |
getItems() |
java.util.function.Function<E,java.lang.String> |
getRowDescriptionProvider()
Returns the
RowDescriptionProvider instance used to generate
descriptions (tooltips) for DataGrid rows |
DataGrid.SelectionMode |
getSelectionMode() |
java.util.List<DataGrid.SortOrder> |
getSortOrder() |
default java.lang.Object |
getSubPart(java.lang.String name) |
java.util.List<DataGrid.Column<E>> |
getVisibleColumns()
Returns a copy of columns not hidden by security permissions.
|
boolean |
isAggregatable() |
boolean |
isColumnReorderingAllowed()
Returns whether column reordering is allowed.
|
boolean |
isColumnsCollapsingAllowed() |
boolean |
isContextMenuEnabled() |
boolean |
isDetailsVisible(E entity)
Checks whether details are visible for the given item.
|
boolean |
isEditorActive()
Returns whether an item is currently being edited in the editor.
|
boolean |
isEditorBuffered()
Gets the buffered editor mode.
|
boolean |
isEditorCrossFieldValidate() |
boolean |
isEditorEnabled()
Checks whether the item editor UI is enabled for this DataGrid.
|
boolean |
isFooterVisible()
Returns the visibility of the footer section.
|
boolean |
isHeaderVisible()
Returns the visibility of the header section.
|
boolean |
isSortable() |
boolean |
isTextSelectionEnabled() |
static <T> org.springframework.core.ParameterizedTypeReference<DataGrid<T>> |
of(java.lang.Class<T> itemClass) |
DataGrid.FooterRow |
prependFooterRow()
Adds a new row at the top of the footer section.
|
DataGrid.HeaderRow |
prependHeaderRow()
Adds a new row at the top of the header section.
|
void |
removeColumn(DataGrid.Column<E> column)
Removes the given column from DataGrid or do nothing if column is
null. |
void |
removeColumn(java.lang.String id)
Removes a column from DataGrid by its Id or do nothing if column is not found.
|
void |
removeFooterRow(DataGrid.FooterRow footerRow)
Removes the given row from the footer section.
|
void |
removeFooterRow(int index)
Removes the row at the given position from the footer section.
|
void |
removeHeaderRow(DataGrid.HeaderRow headerRow)
Removes the given row from the header section.
|
void |
removeHeaderRow(int index)
Removes the row at the given position from the header section.
|
void |
removeRowStyleProvider(java.util.function.Function<? super E,java.lang.String> styleProvider)
Removes style provider for the DataGrid rows.
|
void |
repaint()
Repaint UI representation of the DataGrid without refreshing the table data.
|
void |
scrollTo(E item)
Scrolls to a certain item, using
DataGrid.ScrollDestination.ANY. |
void |
scrollTo(E item,
DataGrid.ScrollDestination destination)
Scrolls to a certain item, using user-specified scroll destination.
|
void |
scrollToEnd()
Scrolls to the last data item.
|
void |
scrollToStart()
Scrolls to the first data item.
|
void |
selectAll()
Marks all the items in the current data source as selected.
|
void |
setAggregatable(boolean aggregatable)
Set to true if aggregation should be enabled.
|
void |
setAggregationPosition(DataGrid.AggregationPosition position)
Sets aggregation row position.
|
void |
setBodyRowHeight(double rowHeight)
Sets the height of a body row.
|
void |
setColumnReorderingAllowed(boolean columnReorderingAllowed)
Sets whether or not column reordering is allowed.
|
void |
setColumnResizeMode(DataGrid.ColumnResizeMode mode)
Sets the column resize mode to use.
|
void |
setColumnsCollapsingAllowed(boolean columnsCollapsingAllowed)
Defines if collapsible attribute can be changed for individual column or not.
|
void |
setContextMenuEnabled(boolean contextMenuEnabled)
Sets whether or not context menu is enabled.
|
void |
setDefaultHeaderRow(DataGrid.HeaderRow headerRow)
Sets the default row of the header.
|
void |
setDetailsGenerator(java.util.function.Function<E,Component> detailsGenerator)
Sets a new details generator for row details.
|
void |
setDetailsVisible(E entity,
boolean visible)
Shows or hides the details for a specific item.
|
void |
setEditorBuffered(boolean editorBuffered)
Sets the buffered editor mode.
|
void |
setEditorCancelCaption(java.lang.String cancelCaption)
Sets the caption on the cancel button in the DataGrid editor.
|
void |
setEditorCrossFieldValidate(boolean validate)
Enables cross field validation in the inline editor.
|
void |
setEditorEnabled(boolean isEnabled)
Sets whether or not the item editor UI is enabled for this DataGrid.
|
void |
setEditorSaveCaption(java.lang.String saveCaption)
Sets the caption on the save button in the DataGrid editor.
|
void |
setEmptyStateLinkClickHandler(java.util.function.Consumer<DataGrid.EmptyStateClickEvent<E>> handler)
Sets click handler for link message.
|
void |
setEmptyStateLinkMessage(java.lang.String linkMessage)
Sets a link message to the middle of DataGrid body that should be appeared when DataGrid is empty.
|
void |
setEmptyStateMessage(java.lang.String message)
Sets a message to the middle of DataGrid body that should be appeared when DataGrid is empty.
|
void |
setEnterPressAction(Action action)
Assigns an action to be executed on Enter key press.
|
void |
setFooterRowHeight(double rowHeight)
Sets the body of a footer row.
|
void |
setFooterVisible(boolean footerVisible)
Sets the visibility of the footer section.
|
void |
setFrozenColumnCount(int numberOfColumns)
Sets the number of frozen columns in this grid.
|
void |
setHeaderRowHeight(double rowHeight)
Sets the body of a body row.
|
void |
setHeaderVisible(boolean headerVisible)
Sets the visibility of the header section.
|
void |
setItemClickAction(Action action)
Assigns an action to be executed on double click on a DataGrid row.
|
void |
setItems(DataGridItems<E> dataGridItems)
Sets an instance of
DataGridItems as the DataGrid data source. |
void |
setRowDescriptionProvider(java.util.function.Function<? super E,java.lang.String> provider)
Sets the
RowDescriptionProvider instance for generating
optional descriptions (tooltips) for DataGrid rows. |
void |
setRowDescriptionProvider(java.util.function.Function<? super E,java.lang.String> provider,
ContentMode contentMode)
Sets the
RowDescriptionProvider instance for generating
optional descriptions (tooltips) for DataGrid rows. |
void |
setSelectionMode(DataGrid.SelectionMode selectionMode)
Sets the DataGrid's selection mode.
|
void |
setSortable(boolean sortable)
Defines if this attribute can be changed for individual column or not.
|
void |
setTextSelectionEnabled(boolean textSelectionEnabled)
Enable or disable text selection in DataGrid cells.
|
void |
sort(java.lang.String columnId,
DataGrid.SortDirection direction)
Sorts the DataGrid data for passed column id in the chosen sort direction.
|
getSelected, getSingleSelected, isMultiSelect, setSelected, setSelectedgetFrame, setFrameaddAction, addAction, getAction, getActionNN, getActions, removeAction, removeAction, removeAllActionsaddStyleName, 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, withUnwrappedCompositiongetButtonsPanel, setButtonsPanelgetIcon, setIcon, setIconFromSetgetContextHelpIconClickHandler, getContextHelpText, isContextHelpTextHtmlEnabled, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabledisCaptionAsHtml, setCaptionAsHtmlgetCaption, setCaptiongetDescription, setDescriptionisDescriptionAsHtml, setDescriptionAsHtmlgetLookupSelectedItems, setLookupSelectHandlerfocus, getTabIndex, isFocusable, setFocusable, setTabIndexisHtmlSanitizerEnabled, setHtmlSanitizerEnabledgetPagination, setPaginationstatic final java.lang.String NAME
static <T> org.springframework.core.ParameterizedTypeReference<DataGrid<T>> of(java.lang.Class<T> itemClass)
@StudioElementsGroup(xmlElement="columns", caption="Columns", icon="io/jmix/ui/icon/element/columns.svg") java.util.List<DataGrid.Column<E>> getColumns()
getVisibleColumns()java.util.List<DataGrid.Column<E>> getVisibleColumns()
getColumns()@Nullable DataGrid.Column<E> getColumn(java.lang.String id)
id - the column Idnull if not foundgetColumnNN(String)DataGrid.Column<E> getColumnNN(java.lang.String id)
id - the column Idjava.lang.IllegalStateException - if not foundgetColumn(String)void addColumn(DataGrid.Column<E> column)
column - the column to addaddColumn(Column, int),
addColumn(String, MetaPropertyPath),
addColumn(String, MetaPropertyPath, int)void addColumn(DataGrid.Column<E> column, int index)
column - the column to addindex - index of a new columnaddColumn(Column),
addColumn(String, MetaPropertyPath),
addColumn(String, MetaPropertyPath, int)DataGrid.Column<E> addColumn(java.lang.String id, @Nullable io.jmix.core.metamodel.model.MetaPropertyPath propertyPath)
id - the column IdpropertyPath - the instance of MetaPropertyPath representing a relative path
to a property from certain MetaClassaddColumn(Column),
addColumn(Column, int),
addColumn(String, MetaPropertyPath, int)DataGrid.Column<E> addColumn(java.lang.String id, @Nullable io.jmix.core.metamodel.model.MetaPropertyPath propertyPath, int index)
id - the column IdpropertyPath - the instance of MetaPropertyPath representing a relative path
to a property from certain MetaClassindex - index of a new columnaddColumn(Column),
addColumn(Column, int),
addColumn(String, MetaPropertyPath)void removeColumn(DataGrid.Column<E> column)
null.column - the column to addremoveColumn(String)void removeColumn(java.lang.String id)
id - the columns IdremoveColumn(Column)@Nullable DataGridItems<E> getItems()
getItems in interface ListComponent<E>void setItems(@Nullable
DataGridItems<E> dataGridItems)
DataGridItems as the DataGrid data source.dataGridItems - the DataGrid data sourcevoid selectAll()
void deselect(E item)
item - the item to deselect, not nullvoid deselectAll()
void sort(java.lang.String columnId,
DataGrid.SortDirection direction)
columnId - id of the column to sortdirection - sort directionjava.util.List<DataGrid.SortOrder> getSortOrder()
boolean isTextSelectionEnabled()
true if text selection is enabled.@StudioProperty(defaultValue="false") void setTextSelectionEnabled(boolean textSelectionEnabled)
false.textSelectionEnabled - specifies whether text selection in DataGrid cells is enabledboolean isColumnReorderingAllowed()
true.true if reordering is allowed@StudioProperty(name="reorderingAllowed", defaultValue="true") void setColumnReorderingAllowed(boolean columnReorderingAllowed)
true.columnReorderingAllowed - specifies whether column reordering is allowedboolean isHeaderVisible()
true if visible, false otherwise@StudioProperty(defaultValue="true") void setHeaderVisible(boolean headerVisible)
headerVisible - true to show the header section, false to hideboolean isFooterVisible()
true if visible, false otherwise@StudioProperty(defaultValue="true") void setFooterVisible(boolean footerVisible)
footerVisible - true to show the footer section, false to hidedouble getBodyRowHeight()
@StudioProperty(name="bodyRowHeight", defaultValue="-1.0") @Min(value=-1L) void setBodyRowHeight(double rowHeight)
rowHeight - the height of a row in pixels or -1 for AUTOdouble getHeaderRowHeight()
@StudioProperty(name="headerRowHeight", defaultValue="-1.0") @Min(value=-1L) void setHeaderRowHeight(double rowHeight)
rowHeight - the height of a row in pixels or -1 for AUTOdouble getFooterRowHeight()
@StudioProperty(name="footerRowHeight", defaultValue="-1.0") @Min(value=-1L) void setFooterRowHeight(double rowHeight)
rowHeight - the height of a row in pixels or -1 for AUTOboolean isContextMenuEnabled()
true if context menu is enabled, false otherwisevoid setContextMenuEnabled(boolean contextMenuEnabled)
true.contextMenuEnabled - specifies whether context menu is enabled@Nullable Action getItemClickAction()
setItemClickAction(Action)setItemClickAction(Action)void setItemClickAction(@Nullable
Action action)
If such action is not set, the table responds to pressing Enter by trying to find and execute the following actions:
shortcut propertyIf one of these actions is found and it is enabled, it is executed.
action - an action to be executed on double click on a DataGrid row@Nullable Action getEnterPressAction()
setEnterPressAction(Action)setEnterPressAction(Action)void setEnterPressAction(@Nullable
Action action)
If such action is not set, the table responds to pressing Enter by trying to find and execute the following actions:
setItemClickAction(Action)shortcut propertyIf one of these actions is found and it is enabled, it is executed.
action - an action to be executed on Enter key presssetItemClickAction(Action)int getFrozenColumnCount()
hidden
columns in the count.setFrozenColumnCount(int)@StudioProperty(name="frozenColumnCount", defaultValue="0") @Min(value=-1L) void setFrozenColumnCount(int numberOfColumns)
The default value is 0.
numberOfColumns - the number of columns that should be frozenjava.lang.IllegalArgumentException - if the column count is < 0 or > the number of visible columnsboolean isSortable()
true if individual column sortable
attribute can be set to true, false otherwise@StudioProperty(defaultValue="true") void setSortable(boolean sortable)
true.sortable - true if individual column sortable
attribute can be set to true, false otherwiseboolean isColumnsCollapsingAllowed()
true if individual column collapsible attribute
can be set to true, false otherwise@StudioProperty(defaultValue="true") void setColumnsCollapsingAllowed(boolean columnsCollapsingAllowed)
true.columnsCollapsingAllowed - true if individual column collapsible attribute
can be set to true, false otherwiseboolean isEditorEnabled()
true if the editor is enabled for this gridsetEditorEnabled(boolean),
getEditedItem()@StudioProperty(defaultValue="false") void setEditorEnabled(boolean isEnabled)
edit(Object) method.isEnabled - true to enable the feature, false otherwisegetEditedItem()boolean isEditorBuffered()
true if buffered editor is enabled, false otherwise@StudioProperty(defaultValue="true") void setEditorBuffered(boolean editorBuffered)
true).editorBuffered - true to enable buffered editor, false to disable itjava.lang.String getEditorSaveCaption()
@StudioProperty(type=LOCALIZED_STRING) void setEditorSaveCaption(java.lang.String saveCaption)
saveCaption - the caption to setjava.lang.String getEditorCancelCaption()
@StudioProperty(type=LOCALIZED_STRING) void setEditorCancelCaption(java.lang.String cancelCaption)
cancelCaption - the caption to set@Nullable E getEditedItem()
null if no item is being edited at the momentboolean isEditorActive()
true if the editor is openvoid edit(E item)
item - the item to editjava.lang.IllegalStateException - if the editor is not enabled or already editing an entity in buffered modejava.lang.IllegalArgumentException - if datasource doesn't contain the entitysetEditorEnabled(boolean)@StudioProperty(name="editorCrossFieldValidate", defaultValue="true") void setEditorCrossFieldValidate(boolean validate)
validate - validate option, true if an editor should validate cross field rulesboolean isEditorCrossFieldValidate()
io.jmix.core.common.event.Subscription addEditorPreCommitListener(java.util.function.Consumer<DataGrid.EditorPreCommitEvent<E>> listener)
listener - the listener to registerio.jmix.core.common.event.Subscription addEditorPostCommitListener(java.util.function.Consumer<DataGrid.EditorPostCommitEvent<E>> listener)
listener - the listener to registerio.jmix.core.common.event.Subscription addEditorCloseListener(java.util.function.Consumer<DataGrid.EditorCloseEvent<E>> listener)
listener - the listener to registerio.jmix.core.common.event.Subscription addEditorOpenListener(java.util.function.Consumer<DataGrid.EditorOpenEvent<E>> listener)
listener - the listener to registervoid repaint()
void scrollTo(E item)
DataGrid.ScrollDestination.ANY.item - item to scroll toscrollTo(Object, ScrollDestination),
scrollToStart(),
scrollToEnd()void scrollTo(E item, DataGrid.ScrollDestination destination)
item - item to scroll todestination - value specifying desired position of scrolled-to rowscrollTo(Object),
scrollToStart(),
scrollToEnd()void scrollToStart()
void scrollToEnd()
DataGrid.ColumnResizeMode getColumnResizeMode()
DataGrid.ColumnResizeMode.ANIMATED.@StudioProperty(type=ENUMERATION, defaultValue="ANIMATED", options={"ANIMATED","SIMPLE"}) void setColumnResizeMode(DataGrid.ColumnResizeMode mode)
DataGrid.ColumnResizeMode.ANIMATED.mode - a ColumnResizeMode valueDataGrid.SelectionMode getSelectionMode()
DataGrid.SelectionMode@StudioProperty(type=ENUMERATION, defaultValue="SINGLE", options={"SINGLE","MULTI","MULTI_CHECK","NONE"}) void setSelectionMode(DataGrid.SelectionMode selectionMode)
selectionMode - the selection mode to usevoid addRowStyleProvider(java.util.function.Function<? super E,java.lang.String> styleProvider)
DataGrid can use several providers to obtain many style names for rows.
styleProvider - a style provider to add, not nullvoid removeRowStyleProvider(java.util.function.Function<? super E,java.lang.String> styleProvider)
styleProvider - a style provider to remove, not null@Nullable java.util.function.Function<E,java.lang.String> getRowDescriptionProvider()
RowDescriptionProvider instance used to generate
descriptions (tooltips) for DataGrid rowsvoid setRowDescriptionProvider(@Nullable
java.util.function.Function<? super E,java.lang.String> provider)
RowDescriptionProvider instance for generating
optional descriptions (tooltips) for DataGrid rows. If a
DataGrid.Column.setDescriptionProvider(Function) is also set,
the row description generated by provider is used for cells
for which the cell description provider returns null.
This method uses the ContentMode.PREFORMATTED content mode.
provider - the description provider to use or null to remove a
previously set provider if anyvoid setRowDescriptionProvider(@Nullable
java.util.function.Function<? super E,java.lang.String> provider,
ContentMode contentMode)
RowDescriptionProvider instance for generating
optional descriptions (tooltips) for DataGrid rows. If a
DataGrid.Column.setDescriptionProvider(Function) is also set,
the row description generated by provider is used for cells
for which the cell description provider returns null.provider - the description provider to use or null to remove a
previously set provider if anycontentMode - the content mode for row tooltipsDataGrid.Column<E> addGeneratedColumn(java.lang.String columnId, java.util.function.Function<DataGrid.ColumnGeneratorEvent<E>,?> generator)
columnId - column identifier as defined in XML descriptorgenerator - column generator instanceaddGeneratedColumn(String, Function, int)DataGrid.Column<E> addGeneratedColumn(java.lang.String columnId, java.util.function.Function<DataGrid.ColumnGeneratorEvent<E>,?> generator, int index)
columnId - column identifier as defined in XML descriptorgenerator - column generator instanceindex - index of a new generated columnaddGeneratedColumn(String, Function)@Nullable java.util.function.Function<DataGrid.ColumnGeneratorEvent<E>,?> getColumnGenerator(java.lang.String columnId)
columnId - the column id for which to return column generator@Nullable java.util.function.Function<E,Component> getDetailsGenerator()
null if not setvoid setDetailsGenerator(@Nullable
java.util.function.Function<E,Component> detailsGenerator)
The currently opened row details will be re-rendered.
detailsGenerator - the details generator to setboolean isDetailsVisible(E entity)
entity - the item for which to check details visibilitytrue if the details are visiblevoid setDetailsVisible(E entity, boolean visible)
entity - the item for which to set details visibilityvisible - true to show the details, or false to hide themio.jmix.core.common.event.Subscription addColumnCollapsingChangeListener(java.util.function.Consumer<DataGrid.ColumnCollapsingChangeEvent> listener)
listener - the listener to registerio.jmix.core.common.event.Subscription addColumnReorderListener(java.util.function.Consumer<DataGrid.ColumnReorderEvent> listener)
listener - the listener to registerio.jmix.core.common.event.Subscription addColumnResizeListener(java.util.function.Consumer<DataGrid.ColumnResizeEvent> listener)
listener - the listener to registerio.jmix.core.common.event.Subscription addSelectionListener(java.util.function.Consumer<DataGrid.SelectionEvent<E>> listener)
listener - the listener to registerio.jmix.core.common.event.Subscription addSortListener(java.util.function.Consumer<DataGrid.SortEvent> listener)
listener - the listener to registerio.jmix.core.common.event.Subscription addContextClickListener(java.util.function.Consumer<DataGrid.ContextClickEvent> listener)
listener - the listener to registerio.jmix.core.common.event.Subscription addItemClickListener(java.util.function.Consumer<DataGrid.ItemClickEvent<E>> listener)
listener - the listener to register@Nullable DataGrid.HeaderRow getHeaderRow(int index)
index - 0 based index for row. Counted from top to bottomDataGrid.HeaderRow appendHeaderRow()
prependHeaderRow(),
addHeaderRowAt(int),
removeHeaderRow(HeaderRow),
removeHeaderRow(int)DataGrid.HeaderRow prependHeaderRow()
appendHeaderRow(),
addHeaderRowAt(int),
removeHeaderRow(HeaderRow),
removeHeaderRow(int)DataGrid.HeaderRow addHeaderRowAt(int index)
index - the position at which to insert the rowappendHeaderRow(),
prependHeaderRow(),
removeHeaderRow(HeaderRow),
removeHeaderRow(int)void removeHeaderRow(@Nullable
DataGrid.HeaderRow headerRow)
headerRow - the row to be removedremoveHeaderRow(int),
addHeaderRowAt(int),
appendHeaderRow(),
prependHeaderRow()void removeHeaderRow(int index)
index - the position of the rowremoveHeaderRow(HeaderRow),
addHeaderRowAt(int),
appendHeaderRow(),
prependHeaderRow()@Nullable DataGrid.HeaderRow getDefaultHeaderRow()
void setDefaultHeaderRow(DataGrid.HeaderRow headerRow)
headerRow - the new default row, or null for no default rowint getHeaderRowCount()
@Nullable DataGrid.FooterRow getFooterRow(int index)
index - 0 based index for row. Counted from top to bottomDataGrid.FooterRow appendFooterRow()
prependFooterRow(),
addFooterRowAt(int),
removeFooterRow(FooterRow),
removeFooterRow(int)DataGrid.FooterRow prependFooterRow()
appendFooterRow(),
addFooterRowAt(int),
removeFooterRow(FooterRow),
removeFooterRow(int)DataGrid.FooterRow addFooterRowAt(int index)
index - the position at which to insert the rowappendFooterRow(),
prependFooterRow(),
removeFooterRow(FooterRow),
removeFooterRow(int)void removeFooterRow(@Nullable
DataGrid.FooterRow footerRow)
footerRow - the row to be removedremoveFooterRow(int),
addFooterRowAt(int),
appendFooterRow(),
prependFooterRow()void removeFooterRow(int index)
index - the position of the rowremoveFooterRow(FooterRow),
addFooterRowAt(int),
appendFooterRow(),
prependFooterRow()int getFooterRowCount()
@Nullable default java.lang.Object getSubPart(java.lang.String name)
getSubPart in interface ActionsHoldergetSubPart in interface HasSubPartsboolean isAggregatable()
@StudioProperty(defaultValue="false") void setAggregatable(boolean aggregatable)
aggregatable - aggregatable optionDataGrid.AggregationPosition getAggregationPosition()
@StudioProperty(type=ENUMERATION, defaultValue="TOP", options={"TOP","BOTTOM"}) void setAggregationPosition(DataGrid.AggregationPosition position)
DataGrid.AggregationPosition.TOP.position - position: DataGrid.AggregationPosition.TOP or DataGrid.AggregationPosition.BOTTOMjava.util.Map<java.lang.String,java.lang.Object> getAggregationResults()
void setEmptyStateMessage(@Nullable
java.lang.String message)
message - message that appears when DataGrid is empty@Nullable java.lang.String getEmptyStateMessage()
void setEmptyStateLinkMessage(@Nullable
java.lang.String linkMessage)
linkMessage - message that appears when DataGrid is emptysetEmptyStateLinkClickHandler(Consumer)@Nullable java.lang.String getEmptyStateLinkMessage()
void setEmptyStateLinkClickHandler(@Nullable
java.util.function.Consumer<DataGrid.EmptyStateClickEvent<E>> handler)
handler - handler to setsetEmptyStateLinkMessage(String)@Nullable java.util.function.Consumer<DataGrid.EmptyStateClickEvent<E>> getEmptyStateLinkClickHandler()