Class Grid
- All Implemented Interfaces:
Serializable,Cloneable,org.zkoss.zk.ui.Component,org.zkoss.zk.ui.ext.Scope,org.zkoss.zk.ui.sys.ComponentCtrl,Paginated
Events: onAfterRender
onAfterRender is sent when the model's data has been rendered.(since 5.0.4)
Besides creating Row programmatically, you can assign
a data model (a ListModel or GroupsModel instance) to a grid via
setModel(ListModel) or setModel(GroupsModel)
and then the grid will retrieve data
by calling ListModel.getElementAt(int) when necessary.
Besides assign a list model, you could assign a renderer
(a RowRenderer instance) to a grid, such that
the grid will use this
renderer to render the data returned by ListModel.getElementAt(int).
If not assigned, the default renderer, which assumes a label per row,
is used.
In other words, the default renderer adds a label to
a row by calling toString against the object returned
by ListModel.getElementAt(int)
There are two ways to handle long content: scrolling and paging.
If AbstractComponent.getMold() is "default", scrolling is used if setHeight(java.lang.String)
is called and too much content to display.
If AbstractComponent.getMold() is "paging", paging is used if two or more pages are
required. To control the number of rows to display in a page, use
setPageSize(int).
If paging is used, the page controller is either created automatically
or assigned explicitly by setPaginal(org.zkoss.zul.ext.Paginal).
The paging controller specified explicitly by setPaginal(org.zkoss.zul.ext.Paginal) is called
the external page controller. It is useful if you want to put the paging
controller at different location (other than as a child component), or
you want to use the same controller to control multiple grids.
Default getZclass(): z-grid.(since 3.5.0)
To have a grid without stripping, you can specify a non-existent
style class to setOddRowSclass(java.lang.String).
Clustering and Serialization
When used in a clustering environment, you have to make RowRenderer
(setRowRenderer(org.zkoss.zul.RowRenderer<?>)) and ListModel (setModel(org.zkoss.zul.ListModel<?>)) either
serializable or re-assign them when sessionDidActivate(org.zkoss.zk.ui.Page) is called.
Render on Demand (rod)
[ZK EE] [Since 5.0.0]For huge data, you can turn on Grid's ROD to request ZK engine to load from
ListModel only the required data chunk and create only the required
Rows in memory and render only the required DOM elements in browser.
So it saves both the memory and the processing time in both server and browser
for huge data. If you don't use the ListModel with the Grid, turn on
the ROD will still have ZK engine to render only a chunk of DOM elements in
browser so it at least saves the memory and processing time in browser. Note
that ROD works only if the Grid is configured to has a limited "view port"
height. That is, either the Grid is in the "paging" mold or you have to
setHeight(String) or setVflex(String) of the Grid to
make ROD works.
You can turn on/off ROD for all Grids in the application or only for a specific Grid. To turn on ROD for all Grids in the application, you have to specify the Library Property "org.zkoss.zul.grid.rod" to "true" in WEB-INF/zk.xml. If you did not specify the Library Property, default is false.
<library-property>
<name>org.zkoss.zul.grid.rod</name>
<value>true</value>
</library-property>
To turn on ROD for a specific Grid, you have to specify the Grid's attribute map with key "org.zkoss.zul.grid.rod" to true. That is, for example, if in a zul file, you shall specify <custom-attributes> of the Grid like this:
<grid ...>
<custom-attributes org.zkoss.zul.grid.rod="true"/>
</grid>
You can mix the Library Property and <custom-attributes> ways together. The <custom-attributes> way always takes higher priority. So you can turn OFF ROD in general and turn ON only some specific Grid component. Or you can turn ON ROD in general and turn OFF only some specific Grid component.
Since only partial Rows are created and rendered in the Grid if
you turn the ROD on, there will be some limitations on accessing Rows.
For example, if you call
Row rowAt100 = (Row) getRows().getChildren().get(100);
The Row in index 100 is not necessary created yet if it is not in the
current "view port" and you will get "null" instead.
And it is generally a bad idea to "cache" the created Row in your
application if you turn the ROD on because rows might be removed later.
Basically, you shall operate on the item of the ListModel rather than on the
Row if you use the ListModel and ROD.
Custom Attributes
- org.zkoss.zul.grid.rod
- Specifies whether to enable ROD (render-on-demand). Notice that you could specify this attribute in any of its ancestor's attributes. It will be inherited.
- org.zkoss.zul.grid.autoSort .(since 5.0.7)
- Specifies whether to sort the model when the following cases:
setModel(org.zkoss.zul.ListModel<?>)is called andColumn.setSortDirection(java.lang.String)is set.Column.setSortDirection(java.lang.String)is called.- Model receives
ListDataEventandColumn.setSortDirection(java.lang.String)is set.
ListDataEvent, you can specifies the value as "ignore.change". Notice that you could specify this attribute in any of its ancestor's attributes. It will be inherited.
It is used only if live data (setModel(ListModel) and
not paging (getPagingChild()).
It is used only if live data (setModel(ListModel) and not paging
(getPagingChild()).
- Author:
- tomyeh
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classA utility class to implementHtmlBasedComponent.getExtraCtrl().Nested classes/interfaces inherited from class org.zkoss.zul.impl.MeshElement
MeshElement.InternalPagingNested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.AbstractComponent.Children, org.zkoss.zk.ui.AbstractComponent.ForwardInfo, org.zkoss.zk.ui.AbstractComponent.TargetInfo -
Field Summary
Fields inherited from class org.zkoss.zul.impl.MeshElement
CSS_FLEX_AUTO_DISABLED_COUNTFields inherited from class org.zkoss.zk.ui.HtmlBasedComponent
_zclassFields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPEFields inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl
AFTER_CHILD_ADDED, AFTER_CHILD_REMOVED, AFTER_CLONED, AFTER_PAGE_ATTACHED, AFTER_PAGE_DETACHED, AFTER_PARENT_CHANGED, CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbeforeChildAdded(org.zkoss.zk.ui.Component newChild, org.zkoss.zk.ui.Component refChild) clone()org.zkoss.zk.ui.ComponentgetCell(int row, int col) Returns the specified cell, or null if not available.Returns the columns.Returns the message to display when there are no itemsgetFoot()Returns the foot.Returns the frozen child.<D,G, F> GroupsModel<D, G, F> Returns the groups model associated with this grid, or null if this grid is associated with aListModelor not associated with any list data model.Collection<org.zkoss.zk.ui.Component>getHeads()Returns a collection of heads, includinggetColumns()and auxiliary heads (Auxhead) (never null).Returns the inner width of this component.<T> ListModel<T>Returns the list model associated with this grid, or null if this grid is associated with aGroupsModelor not associated with any list data model.<T> ListModel<T>getModel()Returns the model associated with this grid, or null if this grid is not associated with any list data model.Returns the style class for the odd rows.Returns the paging controller, or null if not available.Returns the child paging controller that is created automatically, or null if mold is not "paging", or the controller is specified externally bysetPaginal(org.zkoss.zul.ext.Paginal).org.zkoss.zk.ui.sys.PropertyAccessgetPropertyAccess(String prop) Returns the responsive policy.Returns the responsive columns token string.<T> RowRenderer<T>Returns the renderer to render each row, or null if the default renderer is used.getRows()Returns the rows.intReturns the visible rows.booleaninsertBefore(org.zkoss.zk.ui.Component newChild, org.zkoss.zk.ui.Component refChild) protected booleanbooleanisVflex()Returns whether to grow and shrink vertical to fit their given space, so called vertical flexibility.voidvoidHandles a private event, onInitRender.voidonPageAttached(org.zkoss.zk.ui.Page newpage, org.zkoss.zk.ui.Page oldpage) voidonPageDetached(org.zkoss.zk.ui.Page page) voidHandles a private event, onPagingInitRender.protected Paginalpgi()Returns the instance of the @{link Paginal}booleanremoveChild(org.zkoss.zk.ui.Component child) voidRenders allRowif not loaded yet, withgetRowRenderer().voidrenderItems(Set<? extends Row> rows) protected voidrenderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) voidRenders the specifiedRowif not loaded yet, withgetRowRenderer().voidrenderRows(Set<? extends Row> rows) Renders a set of specified rows.voidscrollToIndex(int index) Scroll to the specified row by the given index.voidservice(org.zkoss.zk.au.AuRequest request, boolean everError) Processes an AU request.voidsessionDidActivate(org.zkoss.zk.ui.Page page) voidsessionWillPassivate(org.zkoss.zk.ui.Page page) voidsetActivePage(int pg) Sets the active page (starting from 0).voidsetEmptyMessage(String emptyMessage) Sets the message to display when there are no itemsvoidvoidsetInnerWidth(String innerWidth) Sets the inner width of this component.voidsetModel(GroupsModel<?, ?, ?> model) Sets the groups model associated with this grid.voidSets the list model associated with this grid.voidSets the mold to render this component.voidsetOddRowSclass(String scls) Sets the style class for the odd rows.voidsetPageSize(int pgsz) Sets the page size, a.k.a., the number rows per page.voidsetPaginal(Paginal pgi) Specifies the paging controller.voidsetResponsive(String responsive) Sets the responsive policy.voidsetResponsiveColumns(String columns) Sets the responsive columns token string for stacking mode.voidsetRowRenderer(String clsnm) Sets the renderer by use of a class name.voidsetRowRenderer(RowRenderer<?> renderer) Sets the renderer which is used to render each row ifgetModel()is not null.voidsetVflex(boolean vflex) Sets whether to grow and shrink vertical to fit their given space, so called vertical flexibility.voidvoidsetVisibleRows(int visibleRows) Sets the visible rows.Methods inherited from class org.zkoss.zul.impl.MeshElement
checkBeforeSetRows, evalCSSFlex, getActivePage, getPageCount, getPageSize, getPagingPosition, getSpan, isAutopaging, isPagingDisabled, isSizedByContent, isSpan, setAutopaging, setPagingDisabled, setPagingPosition, setSizedByContent, setSpan, setSpanMethods inherited from class org.zkoss.zul.impl.XulElement
getContext, getCtrlKeys, getPopup, getTooltip, setContext, setContext, setContextAttributes, setCtrlKeys, setPopup, setPopup, setPopupAttributes, setTooltip, setTooltip, setTooltipAttributesMethods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
addSclass, focus, getAction, getClientAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getSkeleton, getStyle, getTabindex, getTabindexInteger, getTooltiptext, getTop, getVflex, getWidth, getZindex, getZIndex, removeSclass, removeSclass, setAction, setClass, setClientAction, setDraggable, setDroppable, setFocus, setHeight0, setHeightDirectly, setHflex, setHflex0, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setSkeleton, setStyle, setTabindex, setTabindex, setTooltiptext, setTop, setTopDirectly, setVflex0, setVflexDirectly, setWidth, setWidth0, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectlyMethods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addCallback, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildRemoved, beforeParentChanged, destroyIndexCacheMap, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, disableHostChanged, enableBindingAnnotation, enableHostChanged, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getCallback, getChildren, getClientAttribute, getClientDataAttribute, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListenerMap, getEventListeners, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getForwards, getId, getIndexCacheMap, getLastChild, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRedrawCallback, getRoot, getShadowFellowIfAny, getShadowRoots, getShadowVariable, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, initIndexCacheMap, invalidate, isChildable, isDisabledHostChanged, isInitialized, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onParentChanged, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, renderPropertiesOnly, replace, response, response, response, service, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setDefinition, setDefinition, setId, setPage, setPageBefore, setParent, setStubonly, setStubonly, setSubBindingAnnotationCount, setTemplate, setVisible, setVisibleDirectly, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerialize
-
Constructor Details
-
Grid
public Grid()
-
-
Method Details
-
onPageAttached
public void onPageAttached(org.zkoss.zk.ui.Page newpage, org.zkoss.zk.ui.Page oldpage) - Specified by:
onPageAttachedin interfaceorg.zkoss.zk.ui.sys.ComponentCtrl- Overrides:
onPageAttachedin classorg.zkoss.zk.ui.AbstractComponent
-
onPageDetached
public void onPageDetached(org.zkoss.zk.ui.Page page) - Specified by:
onPageDetachedin interfaceorg.zkoss.zk.ui.sys.ComponentCtrl- Overrides:
onPageDetachedin classorg.zkoss.zk.ui.AbstractComponent
-
isVflex
public boolean isVflex()Returns whether to grow and shrink vertical to fit their given space, so called vertical flexibility.Default: false.
- Since:
- 3.5.0
-
setVflex
public void setVflex(boolean vflex) Sets whether to grow and shrink vertical to fit their given space, so called vertical flexibility.- Since:
- 3.5.0
-
setVflex
- Overrides:
setVflexin classorg.zkoss.zk.ui.HtmlBasedComponent
-
getRows
Returns the rows. -
getColumns
Returns the columns. -
getFoot
Returns the foot. -
getFrozen
Returns the frozen child.- Since:
- 5.0.0
-
getHeads
Returns a collection of heads, includinggetColumns()and auxiliary heads (Auxhead) (never null).- Since:
- 3.0.0
-
getCell
public org.zkoss.zk.ui.Component getCell(int row, int col) Returns the specified cell, or null if not available.- Parameters:
row- which row to fetch (starting at 0).col- which column to fetch (starting at 0).
-
getVisibleRows
public int getVisibleRows()Returns the visible rows. Zero means no limitation.Default: 0.
- Since:
- 8.5.0
-
setVisibleRows
public void setVisibleRows(int visibleRows) throws org.zkoss.zk.ui.WrongValueException Sets the visible rows.Note: Not allowed to set visibleRows and height/vflex at the same time
- Throws:
org.zkoss.zk.ui.WrongValueException- Since:
- 8.5.0
-
setHeight
- Overrides:
setHeightin classorg.zkoss.zk.ui.HtmlBasedComponent
-
getPaginal
Returns the paging controller, or null if not available. Note: the paging controller is used only ifAbstractComponent.getMold()is "paging".If mold is "paging", this method never returns null, because a child paging controller is created automatically (if not specified by developers with
setPaginal(org.zkoss.zul.ext.Paginal)).If a paging controller is specified (either by
setPaginal(org.zkoss.zul.ext.Paginal), or bysetMold(java.lang.String)with "paging"), the grid will rely on the paging controller to handle long-content instead of scrolling. -
setPaginal
Specifies the paging controller. Note: the paging controller is used only ifAbstractComponent.getMold()is "paging".It is OK, though without any effect, to specify a paging controller even if mold is not "paging".
- Parameters:
pgi- the paging controller. If null andAbstractComponent.getMold()is "paging", a paging controller is created automatically as a child component (seegetPagingChild()).
-
getPagingChild
Returns the child paging controller that is created automatically, or null if mold is not "paging", or the controller is specified externally bysetPaginal(org.zkoss.zul.ext.Paginal).- Since:
- 3.0.7
-
pgi
Description copied from class:MeshElementReturns the instance of the @{link Paginal}- Specified by:
pgiin classMeshElement
-
getModel
Returns the model associated with this grid, or null if this grid is not associated with any list data model.Note: if
setModel(GroupsModel)was called with a groups model, this method returns an instance ofListModelencapsulating it.- See Also:
-
getListModel
Returns the list model associated with this grid, or null if this grid is associated with aGroupsModelor not associated with any list data model.- Since:
- 3.5.0
- See Also:
-
getGroupsModel
Returns the groups model associated with this grid, or null if this grid is associated with aListModelor not associated with any list data model.- Since:
- 3.5.0
- See Also:
-
setModel
Sets the list model associated with this grid. If a non-null model is assigned, no matter whether it is the same as the previous, it will always cause re-render.- Parameters:
model- the list model to associate, or null to dissociate any previous model.- Throws:
org.zkoss.zk.ui.UiException- if failed to initialize with the model- See Also:
-
setModel
Sets the groups model associated with this grid. If a non-null model is assigned, no matter whether it is the same as the previous, it will always cause re-render.The groups model is used to represent a list of data with grouping.
- Parameters:
model- the groups model to associate, or null to dissociate any previous model.- Throws:
org.zkoss.zk.ui.UiException- if failed to initialize with the model- Since:
- 3.5.0
- See Also:
-
getRowRenderer
Returns the renderer to render each row, or null if the default renderer is used. -
setRowRenderer
Sets the renderer which is used to render each row ifgetModel()is not null.Note: changing a render will not cause the grid to re-render. If you want it to re-render, you could assign the same model again (i.e., setModel(getModel())), or fire an
ListDataEventevent.- Parameters:
renderer- the renderer, or null to use the default.- Throws:
org.zkoss.zk.ui.UiException- if failed to initialize with the model
-
setRowRenderer
public void setRowRenderer(String clsnm) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InstantiationException, InvocationTargetException Sets the renderer by use of a class name. It creates an instance automatically. -
setInnerWidth
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. If null, "100%" is assumed.- Since:
- 3.0.0
-
getInnerWidth
Returns the inner width of this component. The inner width is the width of the inner table.Default: "100%"
- Since:
- 3.0.0
- See Also:
-
onInitRender
public void onInitRender()Handles a private event, onInitRender. It is used only for implementation, and you rarely need to invoke it explicitly. -
onPagingInitRender
public void onPagingInitRender()Handles a private event, onPagingInitRender. It is used only for implementation, and you rarely need to invoke it explicitly. -
renderRow
Renders the specifiedRowif not loaded yet, withgetRowRenderer().It does nothing if
getModel()returns null. In other words, it is meaningful only if live data model is used. -
renderAll
public void renderAll()Renders allRowif not loaded yet, withgetRowRenderer(). -
renderRows
Renders a set of specified rows. It is the same asrenderItems(java.util.Set<? extends org.zkoss.zul.Row>). -
renderItems
-
getOddRowSclass
Returns the style class for the odd rows.Default:
getZclass()-odd. (since 3.5.0)- Since:
- 3.0.0
-
setOddRowSclass
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.- Since:
- 3.0.0
-
setMold
Sets the mold to render this component.- Specified by:
setMoldin interfaceorg.zkoss.zk.ui.Component- Overrides:
setMoldin classorg.zkoss.zk.ui.AbstractComponent- Parameters:
mold- the mold. If null or empty, "default" is assumed. Allowed values: default, paging- See Also:
-
ComponentDefinition
-
getZclass
- Overrides:
getZclassin classorg.zkoss.zk.ui.HtmlBasedComponent
-
beforeChildAdded
public void beforeChildAdded(org.zkoss.zk.ui.Component newChild, org.zkoss.zk.ui.Component refChild) - Specified by:
beforeChildAddedin interfaceorg.zkoss.zk.ui.sys.ComponentCtrl- Overrides:
beforeChildAddedin classorg.zkoss.zk.ui.AbstractComponent
-
insertBefore
public boolean insertBefore(org.zkoss.zk.ui.Component newChild, org.zkoss.zk.ui.Component refChild) - Specified by:
insertBeforein interfaceorg.zkoss.zk.ui.Component- Overrides:
insertBeforein classorg.zkoss.zk.ui.AbstractComponent
-
removeChild
public boolean removeChild(org.zkoss.zk.ui.Component child) - Specified by:
removeChildin interfaceorg.zkoss.zk.ui.Component- Overrides:
removeChildin classorg.zkoss.zk.ui.AbstractComponent
-
isAutohidePaging
protected boolean isAutohidePaging()- Specified by:
isAutohidePagingin classMeshElement
-
clone
- Specified by:
clonein interfaceorg.zkoss.zk.ui.Component- Overrides:
clonein classXulElement
-
getEmptyMessage
Returns the message to display when there are no items- Returns:
- String
- Since:
- 5.0.7
-
setEmptyMessage
Sets the message to display when there are no items- Parameters:
emptyMessage-- Since:
- 5.0.7
-
renderProperties
- Overrides:
renderPropertiesin classMeshElement- Throws:
IOException
-
getResponsive
Returns the responsive policy.Default: null (unset — inherits from zk.xml
org.zkoss.zul.grid.responsive, then framework default of no responsive).Stacking behavior is provided by ZK EE (zkmax); CE stores the value only.
- Returns:
- the responsive policy, or null if not set.
- Since:
- 11.0.0
-
setResponsive
Sets the responsive policy.Supported values:
"stacking","none", or null (unset)."stacking"— rows become vertical key-value blocks when the container width falls below the breakpoint (EE only)."none"— explicitly disables responsive, overriding any global setting.null— inherits from the global library property.
- Parameters:
responsive- the responsive policy- Throws:
org.zkoss.zk.ui.WrongValueException- ifresponsiveis neither"stacking","none", nornull.- Since:
- 11.0.0
-
getResponsiveColumns
Returns the responsive columns token string.Default: null (unset — inherits from zk.xml
org.zkoss.zul.grid.responsive.columns, then framework default"sm-1 md-none"resolved by the client).- Returns:
- the responsive columns token string, or null if not set.
- Since:
- 11.0.0
-
setResponsiveColumns
Sets the responsive columns token string for stacking mode.Bootstrap-style breakpoint tokens separated by whitespace, where each token is
<breakpoint>-<value>with breakpoint in {sm, md, lg, xl, xxl} and value either a positive integer (cards per row in stacking) ornone(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. A value whose kept tokens are all
nonewithout ansmentry is discarded as a whole and the client falls back to its default cascade.- Parameters:
columns- the responsive columns token string- Since:
- 11.0.0
-
sessionWillPassivate
public void sessionWillPassivate(org.zkoss.zk.ui.Page page) - Specified by:
sessionWillPassivatein interfaceorg.zkoss.zk.ui.sys.ComponentCtrl- Overrides:
sessionWillPassivatein classorg.zkoss.zk.ui.AbstractComponent
-
sessionDidActivate
public void sessionDidActivate(org.zkoss.zk.ui.Page page) - Specified by:
sessionDidActivatein interfaceorg.zkoss.zk.ui.sys.ComponentCtrl- Overrides:
sessionDidActivatein classorg.zkoss.zk.ui.AbstractComponent
-
getExtraCtrl
- Specified by:
getExtraCtrlin interfaceorg.zkoss.zk.ui.sys.ComponentCtrl- Overrides:
getExtraCtrlin classorg.zkoss.zk.ui.HtmlBasedComponent
-
getPropertyAccess
- Specified by:
getPropertyAccessin interfaceorg.zkoss.zk.ui.sys.ComponentCtrl- Overrides:
getPropertyAccessin classXulElement
-
service
public void service(org.zkoss.zk.au.AuRequest request, boolean everError) Processes an AU request.Default: in addition to what are handled by
HtmlBasedComponent.service(AuRequest, boolean), it also handles onSelect.- Specified by:
servicein interfaceorg.zkoss.zk.ui.sys.ComponentCtrl- Overrides:
servicein classorg.zkoss.zk.ui.HtmlBasedComponent- Since:
- 5.0.0
-
setActivePage
public void setActivePage(int pg) throws org.zkoss.zk.ui.WrongValueException Description copied from class:MeshElementSets the active page (starting from 0).- Overrides:
setActivePagein classMeshElement- Throws:
org.zkoss.zk.ui.WrongValueException
-
setPageSize
public void setPageSize(int pgsz) throws org.zkoss.zk.ui.WrongValueException Description copied from class:MeshElementSets the page size, a.k.a., the number rows per page.- Overrides:
setPageSizein classMeshElement- Throws:
org.zkoss.zk.ui.WrongValueException
-
onAfterRender
public void onAfterRender() -
scrollToIndex
public void scrollToIndex(int index) Scroll to the specified row by the given index.- Parameters:
index- the index of row- Since:
- 8.5.2
-