Interface IColumn<I extends IAnyGroup>

All Superinterfaces:
IChildable<IColumn<I>,I>, IChildrenOfInputgroup<IColumn<I>>, IComponent<IColumn<I>>, IHeaderElement<IColumn<I>>, IHtmlBasedComponent<IColumn<I>>, ILabelElement<IColumn<I>>, ILabelImageElement<IColumn<I>>, IXulElement<IColumn<I>>

public interface IColumn<I extends IAnyGroup> extends IHeaderElement<IColumn<I>>, IChildable<IColumn<I>,I>
Immutable Column component

A single column in a IColumns component. Each child of the IColumn component is placed in each successive cell of the grid. The column with the most child elements determines the number of rows in each column.

The use of column is mainly to define attributes for each cell in the grid.

Support @Action

Name Action Type
onSort ActionData: SortData
Denotes user has sorted the row of this column.
onGroup ActionData: SortData
Denotes user has grouped all the cells under a column. [ZK PE]
onUngroup ActionData: SortData
Denotes user has ungrouped all the cells under a column. [ZK EE]
Author:
katherine
See Also:
  • Column
  • Field Details

    • DEFAULT

      static final IColumn<IAnyGroup> DEFAULT
      Constant for default attributes of this immutable component.
  • Method Details

    • getWidgetClass

      default String getWidgetClass()
      Returns the client widget class.

      Default: "zul.grid.Column"

      Specified by:
      getWidgetClass in interface IComponent<I extends IAnyGroup>
      Returns:
    • getSortDirection

      default String getSortDirection()
      Returns the sort direction.

      Default: "natural".

    • withSortDirection

      IColumn<I> withSortDirection(String sortDirection)
      Returns a copy of this immutable component with the specified sortDirection.

      Sets the sort direction. This does not sort the data, it only serves as an indicator as to how the grid is sorted. (unless the grid has IGrid.isAutosort() attribute for model case)

      Parameters:
      sortDirection - One of "ascending", "descending" and "natural"

      Default: "natural".

      Returns:
      A modified copy of the this object
    • withSortDirection

      default IColumn<I> withSortDirection(IColumn.SortDirection sortDirection)
      Returns a copy of this immutable component with the specified sortDirection.

      Sets the sort direction. This does not sort the data, it only serves as an indicator as to how the grid is sorted. (unless the grid has IGrid.isAutosort() attribute for model case)

      Parameters:
      sortDirection - One of IColumn.SortDirection

      Default: IColumn.SortDirection.NATURAL.

      Returns:
      A modified copy of the this object
    • getSortAscending

      @Nullable Comparator<?> getSortAscending()
      Returns the ascending sorter, or null if not available.

      Default: null

    • withSortAscending

      IColumn<I> withSortAscending(@Nullable Comparator<?> sortAscending)
      Returns a copy of this immutable component with the specified sortAscending.

      Sets the ascending sorter, or null for no sorter for the ascending order.

      Parameters:
      sortAscending - The comparator used to sort the ascending order.

      Default: null.

      Returns:
      A modified copy of the this object
    • withSortAscending

      default IColumn<I> withSortAscending(String sortAscending) throws ClassNotFoundException, InstantiationException, IllegalAccessException
      Returns a copy of this immutable component with the specified sortAscending class name.

      Sets the ascending sorter with the class name, or null for no sorter for the ascending order.

      Parameters:
      sortAscending - The comparator used to sort the ascending order.

      Default: null.

      Returns:
      A modified copy of the this object
      Throws:
      ClassNotFoundException
      InstantiationException
      IllegalAccessException
    • getSortDescending

      @Nullable Comparator<?> getSortDescending()
      Returns the descending sorter, or null if not available.

      Default: null

    • withSortDescending

      IColumn<I> withSortDescending(@Nullable Comparator<?> sortDescending)
      Returns a copy of this immutable component with the specified sortDescending.

      Sets the descending sorter, or null for no sorter for the descending order.

      Parameters:
      sortDescending - The comparator used to sort the descending order.

      Default: null.

      Returns:
      A modified copy of the this object
    • withSortDescending

      default IColumn<I> withSortDescending(String sortDescending) throws ClassNotFoundException, InstantiationException, IllegalAccessException
      Returns a copy of this immutable component with the specified sortDescending class name.

      Sets the descending sorter with the class name, or null for no sorter for the descending order.

      Parameters:
      sortDescending - The comparator used to sort the descending order.

      Default: null.

      Returns:
      A modified copy of the this object
      Throws:
      ClassNotFoundException
      InstantiationException
      IllegalAccessException
    • isResponsiveVisible

      default boolean isResponsiveVisible()
      Returns whether this column is visible when the grid is in responsive (stacking) mode.

      Default: true.

      Since:
      11.0.0
    • withResponsiveVisible

      IColumn<I> withResponsiveVisible(boolean responsiveVisible)
      Returns a copy of this immutable component with the specified responsiveVisible.

      Sets whether this column is visible when the grid is in responsive (stacking) mode. false hides the column only in stacking mode; it stays visible in table mode.

      Parameters:
      responsiveVisible - false to hide this column in stacking mode.

      Default: true.

      Returns:
      A modified copy of the this object
      Since:
      11.0.0
    • of

      static <I extends IAnyGroup> IColumn<I> of(String label)
      Returns the instance with the given label.
      Parameters:
      label - The label belongs to this column.
    • of

      static <I extends IAnyGroup> IColumn<I> of(String label, String image)
      Returns the instance with the given label and image.
      Parameters:
      label - The label that the column holds.
      image - The image that the column holds.
    • of

      static <I extends IAnyGroup> IColumn<I> of(Iterable<? extends I> children)
      Returns the instance with the given any group children.
      Parameters:
      children - The children belong to any group
      See Also:
    • of

      static <I extends IAnyGroup> IColumn<I> of(I... children)
      Returns the instance with the given any group children.
      Parameters:
      children - The children belong to any group
      See Also:
    • ofImage

      static <I extends IAnyGroup> IColumn<I> ofImage(String image)
      Returns the instance with the given image.
      Parameters:
      image - The image that the column holds.
    • ofId

      static <I extends IAnyGroup> IColumn<I> ofId(String id)
      Returns the instance with the given id.
      Parameters:
      id - The id to identify this component