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>
ImmutableGridcomponentSupport @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
-
To turn on the auto-sort facility to sort the model for this component, you have to specify
withAutosort(Autosort)toIGrid.Autosort.ENABLEorIGrid.Autosort.IGNORE_CHANGE.Or configure it from zk.xml by setting library properties. For example,
<library-property/> <name>org.zkoss.zul.grid.autoSort</name/> <value>true</value/> </library-property/>
- Author:
- katherine
- See Also:
Grid
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classIGrid.AutosortSpecifies whether to sort the model when the following cases: WithListModelcase andIColumn.withSortDirection(String)is set.IColumn.withSortDirection(String)is called. Model receivesListDataEventandIColumn.withSortDirection(String)is set. If you want to ignore sorting when receiving ListDataEvent, you can specify the value asIGrid.Autosort.IGNORE_CHANGE.static classIGrid.BuilderBuilds instances of typeIGrid.static classIGrid.UpdaterBuilds an updater of typeIGridforUiAgent.smartUpdate(Locator, SmartUpdater).-
Nested classes/interfaces inherited from interface org.zkoss.stateless.sul.IMeshElement
IMeshElement.PagingPosition
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.lang.StringgetAutosort()Returns whether to sort all items when model or sort direction be changed.default java.util.List<IAuxhead>getAuxhead()Returns the auxhead child.IColumnsgetColumns()Returns the columns.java.lang.StringgetEmptyMessage()Returns the message to display when there are no itemsIFootgetFoot()Returns the foot.IFrozengetFrozen()Returns the frozen child.default java.lang.StringgetInnerWidth()Returns the inner width of this component.default java.lang.StringgetOddRowSclass()Returns the style class for the odd rows.IRowsgetRows()Returns the rows.default intgetVisibleRows()Returns the visible rows.default java.lang.StringgetWidgetClass()Returns the client widget class.static IGridof(java.lang.Iterable<? extends IRowBase> children)Returns the instance with the givenIRowBasechildren.static IGridof(IRowBase... children)Returns the instance with the givenIRowBasechildren.static IGridofColumns(java.lang.Iterable<? extends IColumn<IAnyGroup>> children)Returns the instance with the givenIColumncolumn children.static IGridofColumns(IColumn<IAnyGroup>... children)Returns the instance with the givenIColumncolumn children.static IGridofColumns(IColumns columns)Returns the instance with the givenIColumnschild.static IGridofFoot(IFoot foot)Returns the instance with the givenIFootchild.static IGridofFooters(java.lang.Iterable<? extends IFooter<IAnyGroup>> children)Returns the instance with the givenIFooterfooter children.static IGridofFooters(IFooter<IAnyGroup>... children)Returns the instance with the givenIFooterfooter children.static IGridofId(java.lang.String id)Returns the instance with the given id.default IGridwithAllComponents(java.lang.Iterable<? extends IMeshComposite> elements)Copy the current immutable object with elements that replace the content ofchildren.IGridwithAutosort(java.lang.String autosort)Returns a copy ofthisimmutable component with the specifiedautosort.default IGridwithAutosort(IGrid.Autosort autosort)Returns a copy ofthisimmutable component with the specifiedautosort.IGridwithAuxhead(java.lang.Iterable<? extends IAuxhead> auxhead)Returns a copy ofthisimmutable component with the specifiedauxhead.default IGridwithAuxhead(IAuxhead... auxhead)Returns a copy ofthisimmutable component with the specifiedauxhead.IGridwithColumns(IColumns columns)Returns a copy ofthisimmutable component with the specifiedcolumns.IGridwithEmptyMessage(java.lang.String emptyMessage)Returns a copy ofthisimmutable component with the specifiedemptyMessage.IGridwithFoot(IFoot foot)Returns a copy ofthisimmutable component with the specifiedfoot.IGridwithFrozen(IFrozen frozen)Returns a copy ofthisimmutable component with the specifiedfrozen.IGridwithInnerWidth(java.lang.String innerWidth)Returns a copy ofthisimmutable component with the specifiedinnerWidth.IGridwithOddRowSclass(java.lang.String oddRowSclass)Returns a copy ofthisimmutable component with the specifiedoddRowSclass.IGridwithRows(IRows rows)Returns a copy ofthisimmutable component with the specifiedrows.IGridwithVisibleRows(int visibleRows)Returns a copy ofthisimmutable component with the specifiedvisibleRows.-
Methods inherited from interface org.zkoss.stateless.sul.IComponent
getAction, getActions, getClientAttributes, getId, getMold, getWidgetListeners, getWidgetOverrides, isVisible, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withActions, withActions, withClientAttribute, withClientAttributes, withId, withMold, withVisible, withWidgetClass, withWidgetListener, withWidgetListeners, withWidgetOverride, withWidgetOverrides
-
Methods inherited from interface org.zkoss.stateless.sul.IHtmlBasedComponent
getClientAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZIndex, isFocus, withClientAction, withDraggable, withDroppable, withFocus, withHeight, withHflex, withLeft, withRenderdefer, withSclass, withStyle, withTabindex, withTabindex, withTooltiptext, withTop, withVflex, withWidth, withZclass, withZIndex
-
Methods inherited from interface org.zkoss.stateless.sul.IMeshElement
getPagingChild, getPagingPosition, getSpan, isAutopaging, isNativeScrollbar, isSizedByContent, withAutopaging, withNativeScrollbar, withPagingChild, withPagingPosition, withPagingPosition, withSizedByContent, withSpan, withSpan
-
Methods inherited from interface org.zkoss.stateless.sul.IXulElement
getContext, getCtrlKeys, getPopup, getTooltip, withContext, withCtrlKeys, withPopup, withTooltip
-
-
-
-
Method Detail
-
getWidgetClass
default java.lang.String getWidgetClass()
Returns the client widget class.Default:
"zul.grid.Grid"- Specified by:
getWidgetClassin interfaceIComponent<IGrid>
-
getRows
@Nullable IRows getRows()
Returns the rows.
-
withRows
IGrid withRows(@Nullable IRows rows)
Returns a copy ofthisimmutable component with the specifiedrows.Sets the rows as a child to this component
- Parameters:
rows- The rows child.Default:
null.- Returns:
- A modified copy of the
thisobject
-
getColumns
@Nullable IColumns getColumns()
Returns the columns.Default:
null
-
withColumns
IGrid withColumns(@Nullable IColumns columns)
Returns a copy ofthisimmutable component with the specifiedcolumns.Sets the columns as a child to this component
- Parameters:
columns- The columns child.Default:
null.- Returns:
- A modified copy of the
thisobject
-
getFoot
@Nullable IFoot getFoot()
Returns the foot.Default:
null
-
withFoot
IGrid withFoot(@Nullable IFoot foot)
Returns a copy ofthisimmutable component with the specifiedfoot.Sets the foot as a child to this component
- Parameters:
foot- The foot child.Default:
null.- Returns:
- A modified copy of the
thisobject
-
getFrozen
@Nullable IFrozen getFrozen()
Returns the frozen child.Default:
null.
-
withFrozen
IGrid withFrozen(@Nullable IFrozen frozen)
Returns a copy ofthisimmutable component with the specifiedfrozen.Sets the frozen as a child to this component
- Parameters:
frozen- The foot child.Default:
null.- Returns:
- A modified copy of the
thisobject
-
getEmptyMessage
@Nullable java.lang.String getEmptyMessage()
Returns the message to display when there are no items
-
withEmptyMessage
IGrid withEmptyMessage(@Nullable java.lang.String emptyMessage)
Returns a copy ofthisimmutable component with the specifiedemptyMessage.Sets the message to display when there are no items
- Parameters:
emptyMessage- The message to display when there are no itemsDefault:
null.- Returns:
- A modified copy of the
thisobject
-
getVisibleRows
default int getVisibleRows()
Returns the visible rows. Zero means no limitation.Default:
0.
-
withVisibleRows
IGrid withVisibleRows(int visibleRows)
Returns a copy ofthisimmutable component with the specifiedvisibleRows.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
thisobject
-
getInnerWidth
default java.lang.String getInnerWidth()
Returns the inner width of this component. The inner width is the width of the inner table.Default: "100%"
-
withInnerWidth
IGrid withInnerWidth(java.lang.String innerWidth)
Returns a copy ofthisimmutable component with the specifiedinnerWidth.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
thisobject
-
getAutosort
@Nullable default java.lang.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
ListModelis not set.
-
withAutosort
IGrid withAutosort(@Nullable java.lang.String autosort)
Returns a copy ofthisimmutable component with the specifiedautosort.Sets to enable the auto-sort facility to sort the model for this component. Meaningless if
ListModelis not set.- Parameters:
autosort- The allowed values arenull,"false","true", and"ignore.change".Default:
null.- Returns:
- A modified copy of the
thisobject
-
withAutosort
default IGrid withAutosort(@Nullable IGrid.Autosort autosort)
Returns a copy ofthisimmutable component with the specifiedautosort.Sets to enable the auto-sort facility to sort the model for this component. Meaningless if
ListModelis not set.- Parameters:
autosort- The allowed values arenull,"false","true", and"ignore.change".Default:
null.- Returns:
- A modified copy of the
thisobject
-
getOddRowSclass
default java.lang.String getOddRowSclass()
Returns the style class for the odd rows.Default:
IHtmlBasedComponent.getZclass()-odd.
-
withOddRowSclass
IGrid withOddRowSclass(java.lang.String oddRowSclass)
Returns a copy ofthisimmutable component with the specifiedoddRowSclass.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
thisobject
-
getAuxhead
default java.util.List<IAuxhead> getAuxhead()
Returns the auxhead child.
-
withAuxhead
IGrid withAuxhead(java.lang.Iterable<? extends IAuxhead> auxhead)
Returns a copy ofthisimmutable component with the specifiedauxhead.Sets the list of auxhead as children to this component
- Parameters:
auxhead- The auxhead children.Default:
null.- Returns:
- A modified copy of the
thisobject
-
withAuxhead
default IGrid withAuxhead(IAuxhead... auxhead)
Returns a copy ofthisimmutable component with the specifiedauxhead.Sets the auxhead as a child to this component
- Parameters:
auxhead- The auxhead child.Default:
null.- Returns:
- A modified copy of the
thisobject
-
withAllComponents
default IGrid withAllComponents(java.lang.Iterable<? extends IMeshComposite> elements)
Description copied from interface:ICompositeCopy the current immutable object with elements that replace the content ofchildren. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Specified by:
withAllComponentsin interfaceIComposite<IGrid,IMeshComposite>- Parameters:
elements- An iterable of children elements to set- Returns:
- A modified copy of
thisobject
-
of
static IGrid of(java.lang.Iterable<? extends IRowBase> children)
Returns the instance with the givenIRowBasechildren.- Parameters:
children- The children ofIRowBase
-
of
static IGrid of(IRowBase... children)
Returns the instance with the givenIRowBasechildren.- Parameters:
children- The children ofIRowBase
-
ofColumns
static IGrid ofColumns(IColumns columns)
Returns the instance with the givenIColumnschild.- Parameters:
columns- TheIColumnschild
-
ofColumns
static IGrid ofColumns(java.lang.Iterable<? extends IColumn<IAnyGroup>> children)
Returns the instance with the givenIColumncolumn children.a shortcut of
IChildable.withChildren(java.lang.Iterable<? extends I>)- Parameters:
children- TheIColumnchildren
-
ofColumns
static IGrid ofColumns(IColumn<IAnyGroup>... children)
Returns the instance with the givenIColumncolumn children.a shortcut of
IChildable.withChildren(java.lang.Iterable<? extends I>)- Parameters:
children- TheIColumnchildren
-
ofFoot
static IGrid ofFoot(IFoot foot)
Returns the instance with the givenIFootchild.- Parameters:
foot- TheIFootchild
-
ofFooters
static IGrid ofFooters(java.lang.Iterable<? extends IFooter<IAnyGroup>> children)
Returns the instance with the givenIFooterfooter children.a shortcut of
IChildable.withChildren(java.lang.Iterable<? extends I>)- Parameters:
children- TheIFooterchildren
-
ofFooters
static IGrid ofFooters(IFooter<IAnyGroup>... children)
Returns the instance with the givenIFooterfooter children.a shortcut of
IChildable.withChildren(java.lang.Iterable<? extends I>)- Parameters:
children- TheIFooterchildren
-
ofId
static IGrid ofId(java.lang.String id)
Returns the instance with the given id.- Parameters:
id- The id to identify this component
-
-