Interface IGrid

All Superinterfaces:
IAnyGroup<IGrid>, IComponent<IGrid>, IComposite<IGrid,IMeshComposite>, IHtmlBasedComponent<IGrid>, IMeshElement<IGrid>, IXulElement<IGrid>

public interface IGrid extends IMeshElement<IGrid>, IComposite<IGrid,IMeshComposite>, IAnyGroup<IGrid>
Immutable Grid component

Support @Action

Name Action Type
onPageSize ActionData: PageSizeData
Notifies the paging size has been changed when the autopaging (iGrid.withAutopaging(boolean)) is enabled and a user changed the size of the content.

Support Molds

Name Snapshot
"default"
"paging"

Support Application Library Properties

Note: with zk.xml setting, it will affect to all tree components.
Author:
katherine
See Also:
  • Grid
  • Field Details

    • DEFAULT

      static final IGrid DEFAULT
      Constant for default attributes of this immutable component.
    • PAGING

      static final IGrid PAGING
      Constant for "paging" mold attributes of this immutable component.
  • Method Details

    • getWidgetClass

      default String getWidgetClass()
      Returns the client widget class.

      Default: "zul.grid.Grid"

      Specified by:
      getWidgetClass in interface IComponent<IGrid>
    • getRows

      @Nullable IRows getRows()
      Returns the rows.
    • withRows

      IGrid withRows(@Nullable IRows rows)
      Returns a copy of this immutable component with the specified rows.

      Sets the rows as a child to this component

      Parameters:
      rows - The rows child.

      Default: null.

      Returns:
      A modified copy of the this object
    • getColumns

      @Nullable IColumns getColumns()
      Returns the columns.

      Default: null

    • withColumns

      IGrid withColumns(@Nullable IColumns columns)
      Returns a copy of this immutable component with the specified columns.

      Sets the columns as a child to this component

      Parameters:
      columns - The columns child.

      Default: null.

      Returns:
      A modified copy of the this object
    • getFoot

      @Nullable IFoot getFoot()
      Returns the foot.

      Default: null

    • withFoot

      IGrid withFoot(@Nullable IFoot foot)
      Returns a copy of this immutable component with the specified foot.

      Sets the foot as a child to this component

      Parameters:
      foot - The foot child.

      Default: null.

      Returns:
      A modified copy of the this object
    • getFrozen

      @Nullable IFrozen getFrozen()
      Returns the frozen child.

      Default: null.

    • withFrozen

      IGrid withFrozen(@Nullable IFrozen frozen)
      Returns a copy of this immutable component with the specified frozen.

      Sets the frozen as a child to this component

      Parameters:
      frozen - The foot child.

      Default: null.

      Returns:
      A modified copy of the this object
    • getEmptyMessage

      @Nullable String getEmptyMessage()
      Returns the message to display when there are no items
    • withEmptyMessage

      IGrid withEmptyMessage(@Nullable String emptyMessage)
      Returns a copy of this immutable component with the specified emptyMessage.

      Sets the message to display when there are no items

      Parameters:
      emptyMessage - The message to display when there are no items

      Default: null.

      Returns:
      A modified copy of the this object
    • getVisibleRows

      default int getVisibleRows()
      Returns the visible rows. Zero means no limitation.

      Default: 0.

    • withVisibleRows

      IGrid withVisibleRows(int visibleRows)
      Returns a copy of this immutable component with the specified visibleRows.

      Sets the visible rows. Zero means no limitation.

      Parameters:
      visibleRows - The visible rows. Zero means no limitation.

      Default: 0.

      Returns:
      A modified copy of the this object
    • getInnerWidth

      default String getInnerWidth()
      Returns the inner width of this component. The inner width is the width of the inner table.

      Default: "100%"

    • withInnerWidth

      IGrid withInnerWidth(String innerWidth)
      Returns a copy of this immutable component with the specified innerWidth.

      Sets the inner width of this component. The inner width is the width of the inner table. By default, it is 100%. That is, it is the same as the width of this component. However, it is changed when the user is sizing the column's width.

      Application developers rarely call this method, unless they want to preserve the widths of sizable columns changed by the user. To preserve the widths, the developer have to store the widths of all columns and the inner width (getInnerWidth()), and then restore them when re-creating this component.

      Parameters:
      innerWidth - The inner width of this component.

      Default: "100%".

      Returns:
      A modified copy of the this object
    • getAutosort

      @Nullable default String getAutosort()
      Returns whether to sort all items when model or sort direction be changed.

      Default: false, if the "org.zkoss.zul.grid.autoSort" library property is not set in zk.xml.

      Note: it's meaningless if ListModel is not set.

    • withAutosort

      IGrid withAutosort(@Nullable String autosort)
      Returns a copy of this immutable component with the specified autosort.

      Sets to enable the auto-sort facility to sort the model for this component. Meaningless if ListModel is not set.

      Parameters:
      autosort - The allowed values are null, "false", "true", and "ignore.change".

      Default: null.

      Returns:
      A modified copy of the this object
    • withAutosort

      default IGrid withAutosort(@Nullable IGrid.Autosort autosort)
      Returns a copy of this immutable component with the specified autosort.

      Sets to enable the auto-sort facility to sort the model for this component. Meaningless if ListModel is not set.

      Parameters:
      autosort - The allowed values are null, "false", "true", and "ignore.change".

      Default: null.

      Returns:
      A modified copy of the this object
    • getOddRowSclass

      default String getOddRowSclass()
      Returns the style class for the odd rows.

      Default: IHtmlBasedComponent.getZclass()-odd.

    • withOddRowSclass

      IGrid withOddRowSclass(String oddRowSclass)
      Returns a copy of this immutable component with the specified oddRowSclass.

      Sets the style class for the odd rows. If the style class doesn't exist, the striping effect disappears. You can provide different effects by providing the proper style classes.

      Parameters:
      oddRowSclass - The style class for the odd rows.

      Default: IHtmlBasedComponent.getZclass()-odd .

      Returns:
      A modified copy of the this object
    • getResponsive

      @Nullable String getResponsive()
      Returns the responsive policy set on this component, or null if unset.

      Like Grid.getResponsive() this is the raw value; the zk.xml fallback is resolved by getEffectiveResponsive() at render time.

      Default: null.

      Since:
      11.0.0
    • withResponsive

      IGrid withResponsive(@Nullable String responsive)
      Returns a copy of this immutable component with the specified responsive.

      Sets the responsive policy. "stacking" turns the rows into vertical key-value blocks when the container width falls below the breakpoint; "none" disables it, overriding the library property. The stacking behavior itself is drawn by ZK PE (zkmax).

      Note: UiAgent.smartUpdate(Locator, SmartUpdater) is not supported for this property — IGrid.Updater ships the raw attribute while the initial render ships getEffectiveResponsive(). Push a whole component with UiAgent.replaceWith(Locator, IComponent) instead.

      Parameters:
      responsive - one of "stacking", "none", or null (unset).

      Default: null.

      Returns:
      A modified copy of the this object
      Throws:
      org.zkoss.zk.ui.WrongValueException - if responsive is neither "stacking", "none", nor null.
      Since:
      11.0.0
    • getResponsiveColumns

      @Nullable String getResponsiveColumns()
      Returns the responsive columns token string set on this component, used by "stacking" mode, or null if unset.

      Like Grid.getResponsiveColumns() this is the raw value; the zk.xml fallback is resolved by getEffectiveResponsiveColumns() at render time. Unset means the client applies its own default cascade "sm-1 md-none".

      Default: null.

      Since:
      11.0.0
    • withResponsiveColumns

      IGrid withResponsiveColumns(@Nullable String responsiveColumns)
      Returns a copy of this immutable component with the specified responsiveColumns.

      Sets the responsive columns token string for "stacking" mode. Breakpoint tokens separated by whitespace, where each token is <breakpoint>-<value> with breakpoint in {sm, md, lg, xl} and value either a positive integer (cards per row) or none (switch back to table mode at and above this breakpoint).

      The string is stored verbatim — parsing, cascade resolution, and matching against the current container width happen on the client side. Invalid tokens are silently dropped by the client cascade resolver.

      Note: UiAgent.smartUpdate(Locator, SmartUpdater) is not supported for this property — IGrid.Updater ships the raw attribute while the initial render ships getEffectiveResponsiveColumns(). Push a whole component with UiAgent.replaceWith(Locator, IComponent) instead.

      Parameters:
      responsiveColumns - The responsive columns token string, e.g. "sm-1 md-2 lg-none".

      Default: null.

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

      default List<IAuxhead> getAuxhead()
      Returns the auxhead child.
    • withAuxhead

      IGrid withAuxhead(Iterable<? extends IAuxhead> auxhead)
      Returns a copy of this immutable component with the specified auxhead.

      Sets the list of auxhead as children to this component

      Parameters:
      auxhead - The auxhead children.

      Default: null.

      Returns:
      A modified copy of the this object
    • withAuxhead

      default IGrid withAuxhead(IAuxhead... auxhead)
      Returns a copy of this immutable component with the specified auxhead.

      Sets the auxhead as a child to this component

      Parameters:
      auxhead - The auxhead child.

      Default: null.

      Returns:
      A modified copy of the this object
    • withAllComponents

      default IGrid withAllComponents(Iterable<? extends IMeshComposite> elements)
      Description copied from interface: IComposite
      Copy the current immutable object with elements that replace the content of children. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Specified by:
      withAllComponents in interface IComposite<IGrid,IMeshComposite>
      Parameters:
      elements - An iterable of children elements to set
      Returns:
      A modified copy of this object
    • of

      static IGrid of(Iterable<? extends IRowBase> children)
      Returns the instance with the given IRowBase children.
      Parameters:
      children - The children of IRowBase
    • of

      static IGrid of(IRowBase... children)
      Returns the instance with the given IRowBase children.
      Parameters:
      children - The children of IRowBase
    • ofColumns

      static IGrid ofColumns(IColumns columns)
      Returns the instance with the given IColumns child.
      Parameters:
      columns - The IColumns child
    • ofColumns

      static IGrid ofColumns(Iterable<? extends IColumn<IAnyGroup>> children)
      Returns the instance with the given IColumn column children.

      a shortcut of IChildable.withChildren(java.lang.Iterable<? extends I>)

      Parameters:
      children - The IColumn children
    • ofColumns

      static IGrid ofColumns(IColumn<IAnyGroup>... children)
      Returns the instance with the given IColumn column children.

      a shortcut of IChildable.withChildren(java.lang.Iterable<? extends I>)

      Parameters:
      children - The IColumn children
    • ofFoot

      static IGrid ofFoot(IFoot foot)
      Returns the instance with the given IFoot child.
      Parameters:
      foot - The IFoot child
    • ofFooters

      static IGrid ofFooters(Iterable<? extends IFooter<IAnyGroup>> children)
      Returns the instance with the given IFooter footer children.

      a shortcut of IChildable.withChildren(java.lang.Iterable<? extends I>)

      Parameters:
      children - The IFooter children
    • ofFooters

      static IGrid ofFooters(IFooter<IAnyGroup>... children)
      Returns the instance with the given IFooter footer children.

      a shortcut of IChildable.withChildren(java.lang.Iterable<? extends I>)

      Parameters:
      children - The IFooter children
    • ofId

      static IGrid ofId(String id)
      Returns the instance with the given id.
      Parameters:
      id - The id to identify this component