Package org.zkoss.pivot
Class Pivottable
java.lang.Object
org.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zul.impl.XulElement
org.zkoss.pivot.Pivottable
- All Implemented Interfaces:
Serializable,Cloneable,org.zkoss.zk.ui.Component,org.zkoss.zk.ui.ext.Scope,org.zkoss.zk.ui.sys.ComponentCtrl,org.zkoss.zul.ext.Pageable
public class Pivottable
extends org.zkoss.zul.impl.XulElement
implements org.zkoss.zul.ext.Pageable
Pivottable component. The component takes a PivotModel to populate data.
- Author:
- jumperchen / simonpai
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zk.ui.HtmlBasedComponent.ExtraCtrlNested 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
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final StringFields 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 TypeMethodDescriptionbooleanaddTitleCell(String type, org.zkoss.zk.ui.Component component) Add component in title cellsvoidbeforeChildAdded(org.zkoss.zk.ui.Component newChild, org.zkoss.zk.ui.Component refChild) voidClear custom sizes adjusted by user.clone()intReturns the active page (starting from 0).org.zkoss.zk.ui.ComponentReturn the component in column title cell.org.zkoss.zk.ui.ComponentReturn the component in data title cell.Return the value of data field orientation.getModel()Returns pivot model.intReturns the number of pages.intReturns the number of items per page.Returns the pivot renderer.org.zkoss.zk.ui.ComponentReturn the component in row title cell.intReturns the total number of items.booleaninsertBefore(org.zkoss.zk.ui.Component newChild, org.zkoss.zk.ui.Component refChild) voidInvalidates the pivottable, causing it to rerender.booleanGets whether auto wrap the content and adjust row height.booleanbooleansee:setPageSize(int)booleanReturns whether enables to show the grand total for columns.booleanReturns whether enables to show the grand total for rows.voidonChildRemoved(org.zkoss.zk.ui.Component child) voidonInitRender(org.zkoss.zk.ui.event.Event event) Only internal use to prepare the rendering information from the pivot model.protected voidrenderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) voidservice(org.zkoss.zk.au.AuRequest request, boolean everError) voidsessionDidActivate(org.zkoss.zk.ui.Page page) voidsessionWillPassivate(org.zkoss.zk.ui.Page page) voidsetActivePage(int pg) Set the active pagevoidsetAutowrap(boolean autowrap) Sets whether auto wrap the content and adjust row height Note: It is strongly recommended NOT to use autowrap if there are huge amount of cells in one page or the performance at client side might be horrible.voidsetDataFieldOrient(String orient) Set the orientation of data fields, which determines how data are arranged on the Pivottable when there are more than one data fields.voidsetFrozenColumnHeaders(boolean frozenColumnHeaders) Enable frozen column headers.voidsetGrandTotalForColumns(boolean grandTotalForColumns) Sets whether enables to show the grand total for columns.voidsetGrandTotalForRows(boolean grandTotalForRows) Sets whether enables to show the grand total for rows.voidvoidsetModel(PivotModel model) Sets the pivot model.voidsetPageSize(int size) Sets the items to show in each pagevoidsetPivotRenderer(PivotRenderer renderer) Sets the pivot rendererMethods inherited from class org.zkoss.zul.impl.XulElement
getContext, getCtrlKeys, getPopup, getPropertyAccess, getTooltip, setContext, setContext, setContextAttributes, setCtrlKeys, setPopup, setPopup, setPopupAttributes, setTooltip, setTooltip, setTooltipAttributesMethods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
addSclass, evalCSSFlex, focus, getAction, getClientAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, 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, setStyle, setTabindex, setTabindex, setTooltiptext, setTop, setTopDirectly, setVflex, 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, isDisabledHostChanged, isInitialized, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onPageAttached, onPageDetached, onParentChanged, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeChild, 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, setMold, 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
-
Field Details
-
SCROLL_POS
- See Also:
-
DATA_TITLE
- See Also:
-
COLUMN_TITLE
- See Also:
-
ROW_TITLE
- See Also:
-
-
Constructor Details
-
Pivottable
public Pivottable()
-
-
Method Details
-
setHeight
- Overrides:
setHeightin classorg.zkoss.zk.ui.HtmlBasedComponent
-
getPageSize
public int getPageSize()Returns the number of items per page.Default: 20.
- Specified by:
getPageSizein interfaceorg.zkoss.zul.ext.Pageable
-
setPageSize
public void setPageSize(int size) throws org.zkoss.zk.ui.WrongValueException Sets the items to show in each page- Specified by:
setPageSizein interfaceorg.zkoss.zul.ext.Pageable- Throws:
org.zkoss.zk.ui.WrongValueException
-
getTotalSize
public int getTotalSize()Returns the total number of items. -
getPageCount
public int getPageCount()Returns the number of pages. Note: there is at least one page even no item at all.- Specified by:
getPageCountin interfaceorg.zkoss.zul.ext.Pageable
-
getActivePage
public int getActivePage()Returns the active page (starting from 0).- Specified by:
getActivePagein interfaceorg.zkoss.zul.ext.Pageable
-
setActivePage
public void setActivePage(int pg) throws org.zkoss.zk.ui.WrongValueException Set the active pageNote: In server side, active page starts from 0. But in browser UI, it starts from 1
- Specified by:
setActivePagein interfaceorg.zkoss.zul.ext.Pageable- Throws:
org.zkoss.zk.ui.WrongValueException
-
setGrandTotalForRows
public void setGrandTotalForRows(boolean grandTotalForRows) Sets whether enables to show the grand total for rows.Default: true
-
isGrandTotalForRows
public boolean isGrandTotalForRows()Returns whether enables to show the grand total for rows.Default: true.
-
setGrandTotalForColumns
public void setGrandTotalForColumns(boolean grandTotalForColumns) Sets whether enables to show the grand total for columns.Default: true
-
isGrandTotalForColumns
public boolean isGrandTotalForColumns()Returns whether enables to show the grand total for columns.Default: true.
-
addTitleCell
Add component in title cells- Parameters:
type-DATA_TITLE,COLUMN_TITLE,ROW_TITLE
-
getDataCell
public org.zkoss.zk.ui.Component getDataCell()Return the component in data title cell. -
getColumnCell
public org.zkoss.zk.ui.Component getColumnCell()Return the component in column title cell. -
getRowCell
public org.zkoss.zk.ui.Component getRowCell()Return the component in row title cell. -
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
-
onChildRemoved
public void onChildRemoved(org.zkoss.zk.ui.Component child) - Specified by:
onChildRemovedin interfaceorg.zkoss.zk.ui.sys.ComponentCtrl- Overrides:
onChildRemovedin 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
-
getDataFieldOrient
Return the value of data field orientation. Can only becolumnorrow. -
setDataFieldOrient
Set the orientation of data fields, which determines how data are arranged on the Pivottable when there are more than one data fields.- Parameters:
orient- accepts eithercolumnorrow. Throws an exception otherwise.
-
clearCustomSizes
public void clearCustomSizes()Clear custom sizes adjusted by user. -
getModel
Returns pivot model. -
setModel
Sets the pivot model. -
setPivotRenderer
Sets the pivot renderer -
getPivotRenderer
Returns the pivot renderer. -
setAutowrap
public void setAutowrap(boolean autowrap) Sets whether auto wrap the content and adjust row height Note: It is strongly recommended NOT to use autowrap if there are huge amount of cells in one page or the performance at client side might be horrible.- Parameters:
autowrap-
-
isAutowrap
public boolean isAutowrap()Gets whether auto wrap the content and adjust row height. Note: It is strongly recommended NOT to use autowrap if there are huge amount of cells in one page or the performance at client side might be horrible.- Returns:
- boolean
-
isFrozenColumnHeaders
public boolean isFrozenColumnHeaders()see:setPageSize(int)- Returns:
- boolean
- Since:
- 2.5.0
-
setFrozenColumnHeaders
public void setFrozenColumnHeaders(boolean frozenColumnHeaders) Enable frozen column headers. Useful in combination with a largersetPageSize(int)and fixed height/vflex.
IE not supported. Potential causes performance issues with larger column or row sizes.
Disabled by default.- Parameters:
frozenColumnHeaders-- Since:
- 2.5.0
-
onInitRender
public void onInitRender(org.zkoss.zk.ui.event.Event event) Only internal use to prepare the rendering information from the pivot model. -
getZclass
- Overrides:
getZclassin classorg.zkoss.zk.ui.HtmlBasedComponent
-
renderProperties
- Overrides:
renderPropertiesin classorg.zkoss.zul.impl.XulElement- Throws:
IOException
-
clone
- Specified by:
clonein interfaceorg.zkoss.zk.ui.Component- Overrides:
clonein classorg.zkoss.zul.impl.XulElement
-
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
-
isChildable
public boolean isChildable()- Overrides:
isChildablein classorg.zkoss.zk.ui.AbstractComponent
-
service
public void service(org.zkoss.zk.au.AuRequest request, boolean everError) - Specified by:
servicein interfaceorg.zkoss.zk.ui.sys.ComponentCtrl- Overrides:
servicein classorg.zkoss.zk.ui.HtmlBasedComponent
-
invalidate
public void invalidate()Invalidates the pivottable, causing it to rerender. This method should be called after using Java API to manipulate the model associated with this pivottable. Otherwise, the view will not be updated. e.g. node.setOpen(true); pivottable.invalidate();- Specified by:
invalidatein interfaceorg.zkoss.zk.ui.Component- Overrides:
invalidatein classorg.zkoss.zk.ui.AbstractComponent- Since:
- 2.0.2
-