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>
ImmutableGrid
componentSupport @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.ENABLE
orIGrid.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 class
IGrid.Autosort
Specifies whether to sort the model when the following cases: WithListModel
case andIColumn.withSortDirection(String)
is set.IColumn.withSortDirection(String)
is called. Model receivesListDataEvent
andIColumn.withSortDirection(String)
is set. If you want to ignore sorting when receiving ListDataEvent, you can specify the value asIGrid.Autosort.IGNORE_CHANGE
.static class
IGrid.Builder
Builds instances of typeIGrid
.static class
IGrid.Updater
Builds an updater of typeIGrid
forUiAgent.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.String
getAutosort()
Returns whether to sort all items when model or sort direction be changed.default java.util.List<IAuxhead>
getAuxhead()
Returns the auxhead child.IColumns
getColumns()
Returns the columns.java.lang.String
getEmptyMessage()
Returns the message to display when there are no itemsIFoot
getFoot()
Returns the foot.IFrozen
getFrozen()
Returns the frozen child.default java.lang.String
getInnerWidth()
Returns the inner width of this component.default java.lang.String
getOddRowSclass()
Returns the style class for the odd rows.IRows
getRows()
Returns the rows.default int
getVisibleRows()
Returns the visible rows.default java.lang.String
getWidgetClass()
Returns the client widget class.static IGrid
of(java.lang.Iterable<? extends IRowBase> children)
Returns the instance with the givenIRowBase
children.static IGrid
of(IRowBase... children)
Returns the instance with the givenIRowBase
children.static IGrid
ofColumns(java.lang.Iterable<? extends IColumn<IAnyGroup>> children)
Returns the instance with the givenIColumn
column children.static IGrid
ofColumns(IColumn<IAnyGroup>... children)
Returns the instance with the givenIColumn
column children.static IGrid
ofColumns(IColumns columns)
Returns the instance with the givenIColumns
child.static IGrid
ofFoot(IFoot foot)
Returns the instance with the givenIFoot
child.static IGrid
ofFooters(java.lang.Iterable<? extends IFooter<IAnyGroup>> children)
Returns the instance with the givenIFooter
footer children.static IGrid
ofFooters(IFooter<IAnyGroup>... children)
Returns the instance with the givenIFooter
footer children.static IGrid
ofId(java.lang.String id)
Returns the instance with the given id.default IGrid
withAllComponents(java.lang.Iterable<? extends IMeshComposite> elements)
Copy the current immutable object with elements that replace the content ofchildren
.IGrid
withAutosort(java.lang.String autosort)
Returns a copy ofthis
immutable component with the specifiedautosort
.default IGrid
withAutosort(IGrid.Autosort autosort)
Returns a copy ofthis
immutable component with the specifiedautosort
.IGrid
withAuxhead(java.lang.Iterable<? extends IAuxhead> auxhead)
Returns a copy ofthis
immutable component with the specifiedauxhead
.default IGrid
withAuxhead(IAuxhead... auxhead)
Returns a copy ofthis
immutable component with the specifiedauxhead
.IGrid
withColumns(IColumns columns)
Returns a copy ofthis
immutable component with the specifiedcolumns
.IGrid
withEmptyMessage(java.lang.String emptyMessage)
Returns a copy ofthis
immutable component with the specifiedemptyMessage
.IGrid
withFoot(IFoot foot)
Returns a copy ofthis
immutable component with the specifiedfoot
.IGrid
withFrozen(IFrozen frozen)
Returns a copy ofthis
immutable component with the specifiedfrozen
.IGrid
withInnerWidth(java.lang.String innerWidth)
Returns a copy ofthis
immutable component with the specifiedinnerWidth
.IGrid
withOddRowSclass(java.lang.String oddRowSclass)
Returns a copy ofthis
immutable component with the specifiedoddRowSclass
.IGrid
withRows(IRows rows)
Returns a copy ofthis
immutable component with the specifiedrows
.IGrid
withVisibleRows(int visibleRows)
Returns a copy ofthis
immutable 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:
getWidgetClass
in interfaceIComponent<IGrid>
-
getRows
@Nullable IRows getRows()
Returns the rows.
-
withRows
IGrid withRows(@Nullable IRows rows)
Returns a copy ofthis
immutable 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
this
object
-
getColumns
@Nullable IColumns getColumns()
Returns the columns.Default:
null
-
withColumns
IGrid withColumns(@Nullable IColumns columns)
Returns a copy ofthis
immutable 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
this
object
-
getFoot
@Nullable IFoot getFoot()
Returns the foot.Default:
null
-
withFoot
IGrid withFoot(@Nullable IFoot foot)
Returns a copy ofthis
immutable 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
this
object
-
getFrozen
@Nullable IFrozen getFrozen()
Returns the frozen child.Default:
null
.
-
withFrozen
IGrid withFrozen(@Nullable IFrozen frozen)
Returns a copy ofthis
immutable 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
this
object
-
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 ofthis
immutable 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
this
object
-
getVisibleRows
default int getVisibleRows()
Returns the visible rows. Zero means no limitation.Default:
0
.
-
withVisibleRows
IGrid withVisibleRows(int visibleRows)
Returns a copy ofthis
immutable 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
this
object
-
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 ofthis
immutable 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
this
object
-
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
ListModel
is not set.
-
withAutosort
IGrid withAutosort(@Nullable java.lang.String autosort)
Returns a copy ofthis
immutable component with the specifiedautosort
.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 arenull
,"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 ofthis
immutable component with the specifiedautosort
.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 arenull
,"false"
,"true"
, and"ignore.change"
.Default:
null
.- Returns:
- A modified copy of the
this
object
-
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 ofthis
immutable 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
this
object
-
getAuxhead
default java.util.List<IAuxhead> getAuxhead()
Returns the auxhead child.
-
withAuxhead
IGrid withAuxhead(java.lang.Iterable<? extends IAuxhead> auxhead)
Returns a copy ofthis
immutable 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
this
object
-
withAuxhead
default IGrid withAuxhead(IAuxhead... auxhead)
Returns a copy ofthis
immutable 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
this
object
-
withAllComponents
default IGrid withAllComponents(java.lang.Iterable<? extends IMeshComposite> elements)
Description copied from interface:IComposite
Copy 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:
withAllComponents
in interfaceIComposite<IGrid,IMeshComposite>
- Parameters:
elements
- An iterable of children elements to set- Returns:
- A modified copy of
this
object
-
of
static IGrid of(java.lang.Iterable<? extends IRowBase> children)
Returns the instance with the givenIRowBase
children.- Parameters:
children
- The children ofIRowBase
-
of
static IGrid of(IRowBase... children)
Returns the instance with the givenIRowBase
children.- Parameters:
children
- The children ofIRowBase
-
ofColumns
static IGrid ofColumns(IColumns columns)
Returns the instance with the givenIColumns
child.- Parameters:
columns
- TheIColumns
child
-
ofColumns
static IGrid ofColumns(java.lang.Iterable<? extends IColumn<IAnyGroup>> children)
Returns the instance with the givenIColumn
column children.a shortcut of
IChildable.withChildren(java.lang.Iterable<? extends I>)
- Parameters:
children
- TheIColumn
children
-
ofColumns
static IGrid ofColumns(IColumn<IAnyGroup>... children)
Returns the instance with the givenIColumn
column children.a shortcut of
IChildable.withChildren(java.lang.Iterable<? extends I>)
- Parameters:
children
- TheIColumn
children
-
ofFoot
static IGrid ofFoot(IFoot foot)
Returns the instance with the givenIFoot
child.- Parameters:
foot
- TheIFoot
child
-
ofFooters
static IGrid ofFooters(java.lang.Iterable<? extends IFooter<IAnyGroup>> children)
Returns the instance with the givenIFooter
footer children.a shortcut of
IChildable.withChildren(java.lang.Iterable<? extends I>)
- Parameters:
children
- TheIFooter
children
-
ofFooters
static IGrid ofFooters(IFooter<IAnyGroup>... children)
Returns the instance with the givenIFooter
footer children.a shortcut of
IChildable.withChildren(java.lang.Iterable<? extends I>)
- Parameters:
children
- TheIFooter
children
-
ofId
static IGrid ofId(java.lang.String id)
Returns the instance with the given id.- Parameters:
id
- The id to identify this component
-
-