Class HeaderRow

java.lang.Object
com.vaadin.flow.component.grid.HeaderRow
All Implemented Interfaces:
Serializable

public class HeaderRow extends Object
One row of HeaderRow.HeaderCells in a Grid.
Author:
Vaadin Ltd.
See Also:
  • Field Details

  • Method Details

    • join

      public HeaderRow.HeaderCell join(Grid.Column<?>... columnsToMerge)
      Joins the cells corresponding the given columns in the row.
      Parameters:
      columnsToMerge - the columns of the cells that should be merged
      Returns:
      the merged cell
      See Also:
    • join

      Replaces the given cells with a new cell that takes the full space of the joined cells.

      The cells to join must be adjacent cells in this row, and this row must be the out-most row.

      Parameters:
      cells - the cells to join
      Returns:
      the merged cell
    • isOutmostRow

      protected boolean isOutmostRow()
      Gets whether this is the top-most HeaderRow or the bottom-most FooterRow.
      Returns:
      whether this is the outmost row
    • setLayer

      protected void setLayer(com.vaadin.flow.component.grid.ColumnLayer layer)
      Change this row to wrap the given layer
      Parameters:
      layer - the layer to wrap
    • setColumns

      protected void setColumns(List<com.vaadin.flow.component.grid.AbstractColumn<?>> columns)
      Change the cells to wrap the given columns
      Parameters:
      columns - new column components for the cells
    • addCell

      protected void addCell(int index, com.vaadin.flow.component.grid.AbstractColumn<?> column)
    • removeCell

      protected void removeCell(com.vaadin.flow.component.grid.AbstractColumn<?> columnComponent)
    • getCells

      public List<HeaderRow.HeaderCell> getCells()
      Gets the cells that belong to this row as an unmodifiable list.
      Returns:
      the cells on this row
    • getCell

      public HeaderRow.HeaderCell getCell(Grid.Column<?> column)
      Gets the cell on this row that is on the given column.
      Parameters:
      column - the column to find cell for
      Returns:
      the corresponding cell
      Throws:
      IllegalArgumentException - if the column does not belong to the same grid as this row
    • join

      Replaces the given cells with a new cell that takes the full space of the joined cells.

      The cells to join must be adjacent cells in this row, and this row must be the out-most row.

      The way that the client-side web component works also causes some limitations to which cells can be joined. For example, if you join the first and second cell in the header, you cannot join the second and third cell in the footer. This is because the headers and footers use the same elements in the client-side and it's not possible to create a hierarchical DOM structure to support this case. You can, however, join all three cells in the footer, because then it's again possible to organize the client-side elements in a hierarchical structure.

      Parameters:
      cells - the cells to join
      Returns:
      the merged cell
      Throws:
      IllegalArgumentException - if it's not possible to join the given cells