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.
  • Field Details

  • Method Details

    • of

      static <T> org.springframework.core.ParameterizedTypeReference<DataGrid<T>> of(Class<T> itemClass)
    • 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

      @Nullable DataGrid.Column<E> getColumn(String id)
      Returns a column based on the Id.
      Parameters:
      id - the column Id
      Returns:
      the column or null if not found
      See Also:
    • getColumnNN

      DataGrid.Column<E> getColumnNN(String id)
      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

      void addColumn(DataGrid.Column<E> column)
      Adds the given column to DataGrid.
      Parameters:
      column - the column to add
      See Also:
    • addColumn

      void addColumn(DataGrid.Column<E> column, int index)
      Adds the given column at the specified index to DataGrid.
      Parameters:
      column - the column to add
      index - index of a new column
      See Also:
    • addColumn

      DataGrid.Column<E> addColumn(String id, @Nullable MetaPropertyPath propertyPath)
      Creates new column with given Id and property, then adds this column to DataGrid.
      Parameters:
      id - the column Id
      propertyPath - the instance of MetaPropertyPath representing a relative path to a property from certain MetaClass
      Returns:
      the newly created column
      See Also:
    • addColumn

      DataGrid.Column<E> addColumn(String id, @Nullable MetaPropertyPath propertyPath, int index)
      Creates new column with given Id and property at the specified index, then adds this column to DataGrid.
      Parameters:
      id - the column Id
      propertyPath - the instance of MetaPropertyPath representing a relative path to a property from certain MetaClass
      index - index of a new column
      Returns:
      the newly created column
      See Also:
    • removeColumn

      void removeColumn(DataGrid.Column<E> column)
      Removes the given column from DataGrid or do nothing if column is null.
      Parameters:
      column - the column to add
      See Also:
    • removeColumn

      void removeColumn(String id)
      Removes a column from DataGrid by its Id or do nothing if column is not found.
      Parameters:
      id - the columns Id
      See Also:
    • getItems

      @Nullable DataGridItems<E> getItems()
      Specified by:
      getItems in interface ListComponent<E>
      Returns:
      The DataGrid source
    • setItems

      void setItems(@Nullable DataGridItems<E> dataGridItems)
      Sets an instance of DataGridItems as 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

      void deselect(E item)
      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

      void sort(String columnId, DataGrid.SortDirection direction)
      Sorts the DataGrid data for passed column id in the chosen sort direction.
      Parameters:
      columnId - id of the column to sort
      direction - sort direction
    • getSortOrder

      List<DataGrid.SortOrder> getSortOrder()
      Returns:
      sort order list
    • isTextSelectionEnabled

      boolean isTextSelectionEnabled()
      Returns:
      true if text selection is enabled.
    • setTextSelectionEnabled

      @StudioProperty(defaultValue="false") void setTextSelectionEnabled(boolean textSelectionEnabled)
      Enable or disable text selection in DataGrid cells. Default value is false.
      Parameters:
      textSelectionEnabled - specifies whether text selection in DataGrid cells is enabled
    • isColumnReorderingAllowed

      boolean isColumnReorderingAllowed()
      Returns whether column reordering is allowed. Default value is true.
      Returns:
      true if reordering is allowed
    • setColumnReorderingAllowed

      @StudioProperty(name="reorderingAllowed", defaultValue="true") void setColumnReorderingAllowed(boolean columnReorderingAllowed)
      Sets whether or not column reordering is allowed. Default value is true.
      Parameters:
      columnReorderingAllowed - specifies whether column reordering is allowed
    • isHeaderVisible

      boolean isHeaderVisible()
      Returns the visibility of the header section.
      Returns:
      true if visible, false otherwise
    • setHeaderVisible

      @StudioProperty(defaultValue="true") void setHeaderVisible(boolean headerVisible)
      Sets the visibility of the header section.
      Parameters:
      headerVisible - true to show the header section, false to hide
    • isFooterVisible

      boolean isFooterVisible()
      Returns the visibility of the footer section.
      Returns:
      true if visible, false otherwise
    • setFooterVisible

      @StudioProperty(defaultValue="true") void setFooterVisible(boolean footerVisible)
      Sets the visibility of the footer section.
      Parameters:
      footerVisible - true to show the footer section, false to 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
    • getFooterRowHeight

      double getFooterRowHeight()
      Returns the current footer row height.
      Returns:
      footer row height, -1 if height is AUTO
    • setFooterRowHeight

      @StudioProperty(name="footerRowHeight", defaultValue="-1.0") @Min(-1L) void setFooterRowHeight(double rowHeight)
      Sets the body of a footer 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:
      true if context menu is enabled, false otherwise
    • setContextMenuEnabled

      void setContextMenuEnabled(boolean contextMenuEnabled)
      Sets whether or not context menu is enabled. Default value is true.
      Parameters:
      contextMenuEnabled - specifies whether context menu is enabled
    • getItemClickAction

      @Nullable Action getItemClickAction()
      Returns:
      an action to be executed on double click on a DataGrid row, assigned by setItemClickAction(Action)
      See Also:
    • setItemClickAction

      void setItemClickAction(@Nullable Action action)
      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 shortcut property
      • 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
    • getEnterPressAction

      @Nullable Action getEnterPressAction()
      Returns:
      an action to be executed on Enter key press, assigned by setEnterPressAction(Action)
      See Also:
    • setEnterPressAction

      void setEnterPressAction(@Nullable Action action)
      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 shortcut property
      • 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:
    • 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 includes hidden columns in 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:
      true if individual column sortable attribute can be set to true, false otherwise
    • setSortable

      @StudioProperty(defaultValue="true") void setSortable(boolean sortable)
      Defines if this attribute can be changed for individual column or not. Default value is true.
      Parameters:
      sortable - true if individual column sortable attribute can be set to true, false otherwise
    • isColumnsCollapsingAllowed

      boolean isColumnsCollapsingAllowed()
      Returns:
      true if individual column collapsible attribute can be set to true, false otherwise
    • setColumnsCollapsingAllowed

      @StudioProperty(defaultValue="true") void setColumnsCollapsingAllowed(boolean columnsCollapsingAllowed)
      Defines if collapsible attribute can be changed for individual column or not. Default value is true.
      Parameters:
      columnsCollapsingAllowed - true if individual column collapsible attribute can be set to true, false otherwise
    • isEditorEnabled

      boolean isEditorEnabled()
      Checks whether the item editor UI is enabled for this DataGrid.
      Returns:
      true if the editor is enabled for this grid
      See Also:
    • setEditorEnabled

      @StudioProperty(defaultValue="false") void setEditorEnabled(boolean isEnabled)
      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 the edit(Object) method.
      Parameters:
      isEnabled - true to enable the feature, false otherwise
      See Also:
    • isEditorBuffered

      boolean isEditorBuffered()
      Gets the buffered editor mode.
      Returns:
      true if buffered editor is enabled, false otherwise
    • setEditorBuffered

      @StudioProperty(defaultValue="true") void setEditorBuffered(boolean editorBuffered)
      Sets the buffered editor mode. The default mode is buffered (true).
      Parameters:
      editorBuffered - true to enable buffered editor, false to 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

      @StudioProperty(type=LOCALIZED_STRING) void setEditorSaveCaption(String saveCaption)
      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

      @StudioProperty(type=LOCALIZED_STRING) void setEditorCancelCaption(String cancelCaption)
      Sets the caption on the cancel button in the DataGrid editor.
      Parameters:
      cancelCaption - the caption to set
    • getEditedItem

      @Nullable E getEditedItem()
      Returns the item that is currently being edited.
      Returns:
      the item that is currently being edited, or null if no item is being edited at the moment
    • isEditorActive

      boolean isEditorActive()
      Returns whether an item is currently being edited in the editor.
      Returns:
      true if the editor is open
    • closeEditor

      void closeEditor()
      Closes editor if it's opened.
    • edit

      void edit(E item)
      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 mode
      IllegalArgumentException - 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

      Subscription addEditorPreCommitListener(Consumer<DataGrid.EditorPreCommitEvent<E>> listener)
      Registers a new DataGrid editor pre commit listener. Works in buffered mode only.
      Parameters:
      listener - the listener to register
    • addEditorPostCommitListener

      Subscription addEditorPostCommitListener(Consumer<DataGrid.EditorPostCommitEvent<E>> listener)
      Registers a new DataGrid editor post commit listener. Works in buffered mode only.
      Parameters:
      listener - the listener to register
    • addEditorCloseListener

      Subscription addEditorCloseListener(Consumer<DataGrid.EditorCloseEvent<E>> listener)
      Registers a new DataGrid editor close listener.
      Parameters:
      listener - the listener to register
    • addEditorOpenListener

      Subscription addEditorOpenListener(Consumer<DataGrid.EditorOpenEvent<E>> listener)
      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

      void scrollTo(E item)
      Scrolls to a certain item, using DataGrid.ScrollDestination.ANY.
      Parameters:
      item - item to scroll to
      See Also:
    • scrollTo

      void scrollTo(E item, DataGrid.ScrollDestination destination)
      Scrolls to a certain item, using user-specified scroll destination.
      Parameters:
      item - item to scroll to
      destination - value specifying desired position of scrolled-to row
      See Also:
    • scrollToStart

      void scrollToStart()
      Scrolls to the first data item.
      See Also:
    • scrollToEnd

      void scrollToEnd()
      Scrolls to the last data item.
      See Also:
    • getColumnResizeMode

      DataGrid.ColumnResizeMode getColumnResizeMode()
      Returns the current column resize mode. The default mode is DataGrid.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 is DataGrid.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

      void addRowStyleProvider(Function<? super E,String> styleProvider)
      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

      void removeRowStyleProvider(Function<? super E,String> styleProvider)
      Removes style provider for the DataGrid rows.
      Parameters:
      styleProvider - a style provider to remove, not null
    • getRowDescriptionProvider

      @Nullable Function<E,String> getRowDescriptionProvider()
      Returns the RowDescriptionProvider instance used to generate descriptions (tooltips) for DataGrid rows
      Returns:
      the description provider or null if no provider is set
    • setRowDescriptionProvider

      void setRowDescriptionProvider(@Nullable Function<? super E,String> provider)
      Sets the 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.

      Parameters:
      provider - the description provider to use or null to remove a previously set provider if any
    • setRowDescriptionProvider

      void setRowDescriptionProvider(@Nullable Function<? super E,String> provider, ContentMode contentMode)
      Sets the 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.
      Parameters:
      provider - the description provider to use or null to remove a previously set provider if any
      contentMode - 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 descriptor
      generator - 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 descriptor
      generator - column generator instance
      index - index of a new generated column
      See Also:
    • getColumnGenerator

      @Nullable Function<DataGrid.ColumnGeneratorEvent<E>,?> getColumnGenerator(String columnId)
      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

      @Nullable Function<E,Component> getDetailsGenerator()
      Returns:
      the current details generator for row details or null if not set
    • setDetailsGenerator

      void setDetailsGenerator(@Nullable Function<E,Component> detailsGenerator)
      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

      boolean isDetailsVisible(E entity)
      Checks whether details are visible for the given item.
      Parameters:
      entity - the item for which to check details visibility
      Returns:
      true if the details are visible
    • setDetailsVisible

      void setDetailsVisible(E entity, boolean visible)
      Shows or hides the details for a specific item.
      Parameters:
      entity - the item for which to set details visibility
      visible - true to show the details, or false to hide them
    • addColumnCollapsingChangeListener

      Subscription addColumnCollapsingChangeListener(Consumer<DataGrid.ColumnCollapsingChangeEvent> listener)
      Registers a new column collapsing change listener.
      Parameters:
      listener - the listener to register
    • addColumnReorderListener

      Subscription addColumnReorderListener(Consumer<DataGrid.ColumnReorderEvent> listener)
      Registers a new column reorder listener.
      Parameters:
      listener - the listener to register
    • addColumnResizeListener

      Subscription addColumnResizeListener(Consumer<DataGrid.ColumnResizeEvent> listener)
      Registers a new column resize listener.
      Parameters:
      listener - the listener to register
    • addSelectionListener

      Subscription addSelectionListener(Consumer<DataGrid.SelectionEvent<E>> listener)
      Registers a new selection listener
      Parameters:
      listener - the listener to register
    • addSortListener

      Subscription addSortListener(Consumer<DataGrid.SortEvent> listener)
      Registers a new sort order change listener
      Parameters:
      listener - the listener to register
    • addContextClickListener

      Subscription addContextClickListener(Consumer<DataGrid.ContextClickEvent> listener)
      Registers a new context click listener
      Parameters:
      listener - the listener to register
    • addItemClickListener

      Subscription addItemClickListener(Consumer<DataGrid.ItemClickEvent<E>> listener)
      Registers a new item click listener
      Parameters:
      listener - the listener to register
    • getHeaderRow

      @Nullable DataGrid.HeaderRow getHeaderRow(int index)
      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

      DataGrid.HeaderRow addHeaderRowAt(int index)
      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

      void removeHeaderRow(@Nullable DataGrid.HeaderRow headerRow)
      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

      @Nullable DataGrid.HeaderRow 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

      void setDefaultHeaderRow(DataGrid.HeaderRow headerRow)
      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
    • getFooterRow

      @Nullable DataGrid.FooterRow getFooterRow(int index)
      Gets the footer row at given index.
      Parameters:
      index - 0 based index for row. Counted from top to bottom
      Returns:
      footer row at given index
    • appendFooterRow

      DataGrid.FooterRow appendFooterRow()
      Adds a new row at the bottom of the footer section.
      Returns:
      the new row
      See Also:
    • prependFooterRow

      DataGrid.FooterRow prependFooterRow()
      Adds a new row at the top of the footer section.
      Returns:
      the new row
      See Also:
    • addFooterRowAt

      DataGrid.FooterRow addFooterRowAt(int index)
      Inserts a new row at the given position to the footer 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:
    • removeFooterRow

      void removeFooterRow(@Nullable DataGrid.FooterRow footerRow)
      Removes the given row from the footer section.
      Parameters:
      footerRow - the row to be removed
      See Also:
    • removeFooterRow

      void removeFooterRow(int index)
      Removes the row at the given position from the footer section.
      Parameters:
      index - the position of the row
      See Also:
    • getFooterRowCount

      int getFooterRowCount()
      Gets the row count for the footer.
      Returns:
      row count
    • getSubPart

      @Nullable default Object getSubPart(String name)
      Specified by:
      getSubPart in interface ActionsHolder
      Specified by:
      getSubPart in interface HasSubParts
    • isAggregatable

      boolean isAggregatable()
      Returns:
      true if DataGrid is aggregatable
    • setAggregatable

      @StudioProperty(defaultValue="false") void setAggregatable(boolean aggregatable)
      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 is DataGrid.AggregationPosition.TOP.
      Parameters:
      position - position: DataGrid.AggregationPosition.TOP or DataGrid.AggregationPosition.BOTTOM
    • getAggregationResults

      Map<String,Object> getAggregationResults()
      Returns:
      aggregated values for columns
    • setEmptyStateMessage

      void setEmptyStateMessage(@Nullable String message)
      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

      @Nullable String getEmptyStateMessage()
      Returns:
      message that should be appeared when DataGrid is empty
    • setEmptyStateLinkMessage

      void setEmptyStateLinkMessage(@Nullable String linkMessage)
      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

      @Nullable String getEmptyStateLinkMessage()
      Returns:
      link message that should be appeared when DataGrid is empty
    • setEmptyStateLinkClickHandler

      void setEmptyStateLinkClickHandler(@Nullable Consumer<DataGrid.EmptyStateClickEvent<E>> handler)
      Sets click handler for link message. Link message can be shown when DataGrid is empty.
      Parameters:
      handler - handler to set
      See Also:
    • getEmptyStateLinkClickHandler

      @Nullable Consumer<DataGrid.EmptyStateClickEvent<E>> getEmptyStateLinkClickHandler()
      Returns:
      click handler for link message
    • getMinHeight

      @Nullable Float getMinHeight()
      Specified by:
      getMinHeight in interface HasMinSize
      Returns:
      min-height CSS property value of the Grid (not a composition) or null if not set
    • getMinHeightSizeUnit

      @Nullable SizeUnit getMinHeightSizeUnit()
      Specified by:
      getMinHeightSizeUnit in interface HasMinSize
      Returns:
      unit size of min-height CSS property value of the Grid (not a composition)
    • setMinHeight

      void setMinHeight(@Nullable String minHeight)
      Sets minHeight CSS property value to the Grid (not a composition). To set CSS properties to the composition use css attribute in the XML descriptor or HtmlAttributes.applyCss(Component, String).
      Specified by:
      setMinHeight in interface HasMinSize
      Parameters:
      minHeight - property value
    • getMinWidth

      @Nullable Float getMinWidth()
      Specified by:
      getMinWidth in interface HasMinSize
      Returns:
      min-width CSS property value of the Grid (not a composition) or null if not set
    • getMinWidthSizeUnit

      @Nullable SizeUnit getMinWidthSizeUnit()
      Specified by:
      getMinWidthSizeUnit in interface HasMinSize
      Returns:
      unit size of min-width CSS property value of the Grid (not a composition)
    • setMinWidth

      void setMinWidth(@Nullable String minWidth)
      Sets minWidth CSS property value to the Grid (not a composition). To set CSS properties to the composition use css attribute in the XML descriptor or HtmlAttributes.applyCss(Component, String).
      Specified by:
      setMinWidth in interface HasMinSize
      Parameters:
      minWidth - property value