Interface IMeshElement<I extends IMeshElement>

  • All Superinterfaces:
    IComponent<I>, IHtmlBasedComponent<I>, IXulElement<I>
    All Known Subinterfaces:
    IGrid, IListbox, ITree

    public interface IMeshElement<I extends IMeshElement>
    extends IXulElement<I>
    Immutable MeshElement interface

    The fundamental class for mesh components such as IGrid, IListbox, and ITree.

    Sticky Header

    After adding a sclass "z-sticky-header", when we scroll down a page and make a Mesh component's header out of visible range in a viewport, the Mesh component's header becomes floating and sticky on the top of the page.
    For example,

     
     return meshComp.withSclass("z-sticky-header");
     
     

    Support Application Library Properties

    • To set to use Browser's scrollbar or not, you have to specify withNativeScrollbar(boolean).

      Or configure it from zk.xml by setting library properties. For example,

        <library-property/>
           <name>org.zkoss.zul.nativebar</name/>
           <value>false</value/>
       </library-property/>
       
       
    Note: with zk.xml setting, it will affect to all subcomponents which extend from IMeshElement.
    Author:
    katherine
    • Method Detail

      • getSpan

        @Nullable
        java.lang.String getSpan()
        Return column span hint of this component.

        Default: null

      • withSpan

        I withSpan​(@Nullable
                   java.lang.String span)
        Returns a copy of this immutable component with the specified span.

        Sets column span hint of this component. String number span indicates how this component distributes remaining empty space to the specified column(0-based). "0" means distribute remaining empty space to the 1st column; "1" means distribute remaining empty space to the 2nd column, etc.. The spanning column will grow to fit the extra remaining space.

        Special span hint with "true" means span ALL columns proportionally per their original widths while null or "false" means NOT spanning any column.

        Default: null. That is, NOT span any column.

        Note: span is meaningful only if there is remaining empty space for columns.

        Parameters:
        span - The column span hint.
        Returns:
        A modified copy of the this object
      • withSpan

        default I withSpan​(boolean span)
        Returns a copy of this immutable component with the specified span.

        Sets whether distributes remaining empty space of this component to ALL columns proportionally.

        Default: false. That is, NOT span any column.

        Note: span is meaningful only if there is remaining empty space for columns.

        Parameters:
        span - Whether to span the width of ALL columns to occupy the whole mesh element(grid/listbox/tree).
        Returns:
        A modified copy of the this object
      • getPagingChild

        @Nullable
        IPaging getPagingChild()
        Returns the instance of the IPaging

        Default: null, if in "paging" mold, it won't be null

      • withPagingChild

        I withPagingChild​(@Nullable
                          IPaging pagingChild)
        Returns a copy of this immutable component with the specified pagingChild.

        Sets the paging child component to this mesh component

        Parameters:
        pagingChild - The paging child.

        Default: null.

        Returns:
        A modified copy of the this object
      • isSizedByContent

        default boolean isSizedByContent()
        Returns whether sizing grid/listbox/tree column width by its content.

        Default: false.

      • withSizedByContent

        I withSizedByContent​(boolean sizedByContent)
        Returns a copy of this immutable component with the specified sizedByContent.

        Sets whether sizing grid/listbox/tree column width by its content; it equals to set withHflex("min") on each column.

        Parameters:
        sizedByContent - Whether to enable the column width is sized by its content.

        Default: false.

        Returns:
        A modified copy of the this object
      • isAutopaging

        default boolean isAutopaging()
        Returns whether the auto-paging facility is turned on when the mold is "paging". If it is set to true, the getPagingChild().getPageSize() is ignored; rather, the page size is automatically determined by the height of the mesh component dynamically.

        Default: false

        Returns:
        whether the auto-paging facility is turned on.
      • withAutopaging

        I withAutopaging​(boolean autopaging)
        Returns a copy of this immutable component with the specified autopaging.

        Sets whether the auto-paging facility is turned on when the mold is "paging". If it is set to true, the getPagingChild().getPageSize() is ignored; rather, the page size is automatically determined by the height of the mesh component dynamically.

        Note: Due to performance concern, Autopaging functionality does not support IDetail components.

        Parameters:
        autopaging - True to turn on the auto-paging facility.
        Returns:
        A modified copy of the this object
      • getPagingPosition

        default java.lang.String getPagingPosition()
        Returns how to position the paging of mesh component at the client screen. It is meaningless if the mold is not in "paging".

        Default: "bottom"

      • withPagingPosition

        I withPagingPosition​(java.lang.String pagingPosition)
        Returns a copy of this immutable component with the specified pagingPosition.

        Sets how to position the paging of mesh component at the client screen. It is meaningless if the mold is not in "paging".

        Parameters:
        pagingPosition - How to position. It can only be "bottom" (the default), or "top", or "both".
        Returns:
        A modified copy of the this object
      • withPagingPosition

        default I withPagingPosition​(IMeshElement.PagingPosition pagingPosition)
        Returns a copy of this immutable component with the specified pagingPosition.

        Sets how to position the paging of mesh component at the client screen. It is meaningless if the mold is not in "paging".

        Parameters:
        pagingPosition - How to position.
        Returns:
        A modified copy of the this object
        See Also:
        IMeshElement.PagingPosition
      • isNativeScrollbar

        default boolean isNativeScrollbar()
        Returns whether to use Browser's scrollbar or a floating scrollbar (if with false).

        Default: true to use Browser's scrollbar, if the "org.zkoss.zul.nativebar" library property is not set in zk.xml.

      • withNativeScrollbar

        I withNativeScrollbar​(boolean nativeScrollbar)
        Returns a copy of this immutable component with the specified nativeScrollbar.

        Sets to use Browser's scrollbar or a floating scrollbar

        Parameters:
        nativeScrollbar - true to use Browser's scrollbar, or false to use a floating scrollbar.

        Default: true.

        Returns:
        A modified copy of the this object