Package io.jmix.pivottable.component
Interface PivotTable
- All Superinterfaces:
Component
,Component.BelongToFrame
,Component.Editable
,Component.HasCaption
,Component.HasDescription
- All Known Implementing Classes:
PivotTableImpl
@StudioComponent(caption="PivotTable",
category="Components",
xmlElement="pivotTable",
xmlns="http://jmix.io/schema/ui/pivot-table",
xmlnsAlias="pivot",
icon="io/jmix/pivottable/icon/table.svg",
canvasIcon="io/jmix/pivottable/icon/table.svg",
canvasIconSize=LARGE,
documentationURL="https://docs.jmix.io/jmix/%VERSION%/pivot-table/index.html")
public interface PivotTable
extends Component, Component.BelongToFrame, Component.Editable, Component.HasCaption
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
Describes PivotTable cell click event.static class
Describes PivotTable refresh event.Nested classes/interfaces inherited from interface io.jmix.ui.component.Component
Component.Alignment, Component.BelongToFrame, Component.Disposable, Component.Editable, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, Component.HasXmlDescriptor, Component.Wrapper
-
Field Summary
Fields inherited from interface io.jmix.ui.component.Component
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAggregationProperties
(String... aggregationProperties) Adds an array of properties names to prepopulate in vals area (gets passed to aggregator generating function).Adds a listener to the pivot table cell click events.void
addColumns
(String... cols) Adds an array of property names to use as columns.void
Adds a data item to data provider.void
addExclusions
(String property, String... exclusions) Adds a values to given key of exclusions map.void
addHiddenFromAggregations
(String... hiddenFromAggregations) Adds an array of properties names to omit from the aggregation arguments dropdowns.void
addHiddenFromDragDrop
(String... hiddenFromDragDrop) Adds an array of properties names to omit from the drag'n'drop portion of the UI.void
addHiddenProperties
(String... hiddenProperties) Adds an array of properties names to omit from the UI.void
addInclusions
(String property, String... inclusions) Adds a values to given key of inclusions map.void
addProperties
(Map<String, String> properties) Adds a map whose keys areDataItem
property names to use as pivot table data and values they localized names.void
addProperty
(String property, String value) Add a property with its localized valueaddRefreshListener
(Consumer<PivotTable.RefreshEvent> refreshListener) Adds a listener to the pivot table refresh events.void
Adds an array of properties names to use as rows.getRows()
isShowUI()
void
repaint()
Resend all items and properties to client and repaint pivot table.void
setAggregation
(Aggregation aggregation) Sets the aggregation object.void
setAggregationProperties
(List<String> aggregationProperties) Sets the list of properties names to prepopulate in vals area (gets passed to aggregator generating function).void
setAggregations
(Aggregations aggregations) Sets the aggregations object which defines the collection of aggregations to use in pivot table and additional settings for them.void
setAutoSortUnusedProperties
(Boolean autoSortUnusedProperties) Controls whether or not unused properties are kept sorted in the UI.void
setColumnOrder
(ColumnOrder columnOrder) Set the order in which column data is provided to the renderer.void
setColumns
(List<String> cols) Sets the list of property names to use as columns.void
setDataProvider
(DataProvider dataProvider) Sets data provider for PivotTable.void
setDerivedProperties
(DerivedProperties derivedProperties) Sets object to define derived properties.void
setEmptyDataMessage
(String emptyDataMessage) Sets the message that will be displayed in case of empty data.void
setExclusions
(String property, List<String> exclusions) Sets the value of exclusions map.void
setExclusions
(Map<String, List<String>> exclusions) Sets map whose keys are properties names and values are lists of properties values which denote records to exclude from rendering; used to prepopulate the filter menus that appear on double-click.void
setFilterFunction
(JsFunction filter) Sets theJsFunction
which defines a javascript code called on each record, returnsfalse
if the record is to be excluded from the input before rendering ortrue
otherwisevoid
setHiddenFromAggregations
(List<String> hiddenFromAggregations) Sets the list of properties names to omit from the aggregation arguments dropdowns.void
setHiddenFromDragDrop
(List<String> hiddenFromDragDrop) Sets the list of properties names to omit from the drag'n'drop portion of the UI.void
setHiddenProperties
(List<String> hiddenProperties) Sets the list of properties names to omit from the UI.void
setInclusions
(String property, List<String> inclusions) Sets the value of inclusions map.void
setInclusions
(Map<String, List<String>> inclusions) Sets map whose keys are properties names and values are lists of properties values which denote records to include in rendering; used to prepopulate the filter menus that appear on double-click (overridesexclusions
).void
setMenuLimit
(Integer menuLimit) Sets maximum number of values to list in the double-click menu.void
setNativeJson
(String json) Set additional JSON configuration as a string.void
setProperties
(Map<String, String> properties) Sets the map whose keys areDataItem
property names to use as pivot table data and values they localized names.void
setRenderer
(Renderer renderer) Sets the renderer object.void
setRendererOptions
(RendererOptions rendererOptions) Sets object passed through to renderer as options.void
setRenderers
(Renderers renderers) Sets the renderers object which defines the collection of renderers to use in pivot table and additional settings for them.void
setRowOrder
(RowOrder rowOrder) Sets the order in which row data is provided to the renderer.void
Sets the list of properties names to use as rows.void
setShowColTotals
(Boolean showColTotals) Setfalse
if col totals shouldn't be shown andtrue
otherwise.void
setShowRowTotals
(Boolean showRowTotals) Setfalse
if row totals shouldn't be shown andtrue
otherwise.void
Hides or shows UI elements in the editable pivot table.void
setSortersFunction
(JsFunction sorters) Sets theJsFunction
which defines a javascript code called with an property name and can return a function which can be used as an argument toArray.sort
for output purposes.void
setUnusedPropertiesVertical
(UnusedPropertiesVertical unusedPropertiesVertical) Controls whether or not unused properties are shown vertically instead of the default which is horizontally.Methods inherited from interface io.jmix.ui.component.Component
addStyleName, getAlignment, getHeight, getHeightSizeUnit, getId, getParent, getStyleName, getWidth, getWidthSizeUnit, isEnabled, isEnabledRecursive, isResponsive, isVisible, isVisibleRecursive, removeStyleName, setAlignment, setEnabled, setHeight, setHeightAuto, setHeightFull, setId, setParent, setResponsive, setSizeAuto, setSizeFull, setStyleName, setVisible, setWidth, setWidthAuto, setWidthFull, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, withUnwrapped, withUnwrappedComposition
Methods inherited from interface io.jmix.ui.component.Component.BelongToFrame
getFrame, setFrame
Methods inherited from interface io.jmix.ui.component.Component.Editable
isEditable, isEditableWithParent, setEditable
Methods inherited from interface io.jmix.ui.component.Component.HasCaption
getCaption, setCaption
Methods inherited from interface io.jmix.ui.component.Component.HasDescription
getDescription, setDescription
-
Field Details
-
NAME
- See Also:
-
-
Method Details
-
repaint
void repaint()Resend all items and properties to client and repaint pivot table. Use this method if you change some property of already displayed pivot table. -
getProperties
- Returns:
- the map whose keys are
DataItem
property names to use as pivot table data and values they localized names
-
setProperties
@StudioElementsGroup(xmlElement="properties", caption="Properties", icon="io/jmix/pivottable/icon/properties.svg", elementClass="io.jmix.pivottable.model.meta.Property") void setProperties(Map<String, String> properties) Sets the map whose keys areDataItem
property names to use as pivot table data and values they localized names.- Parameters:
properties
- a map of properties names with localized values
-
addProperties
Adds a map whose keys areDataItem
property names to use as pivot table data and values they localized names.- Parameters:
properties
- a map of properties names with localized values
-
addProperty
Add a property with its localized value- Parameters:
property
- property namevalue
- localized value
-
getRows
- Returns:
- the list of properties names to use as rows.
-
setRows
@StudioElementsGroup(xmlElement="rows", caption="Rows", icon="io/jmix/pivottable/icon/row.svg", elementClass="io.jmix.pivottable.model.meta.Row") void setRows(List<String> rows) Sets the list of properties names to use as rows.- Parameters:
rows
- a list of properties names
-
addRows
Adds an array of properties names to use as rows.- Parameters:
rows
- an array of properties names
-
getColumns
- Returns:
- the list of property names to use as columns.
-
setColumns
@StudioElementsGroup(xmlElement="columns", caption="Columns", icon="io/jmix/pivottable/icon/columns.svg", elementClass="io.jmix.pivottable.model.meta.Column") void setColumns(List<String> cols) Sets the list of property names to use as columns.- Parameters:
cols
- a list of properties names
-
addColumns
Adds an array of property names to use as columns.- Parameters:
cols
- an array of properties names
-
getAggregation
Aggregation getAggregation()- Returns:
- the aggregation object which defines how pivot table will aggregate results per cell
-
setAggregation
Sets the aggregation object.Applies only when
editable=false
.- Parameters:
aggregation
- an aggregation object
-
getRenderer
Renderer getRenderer()- Returns:
- the renderer object which generates output from pivot data structure
-
setRenderer
Sets the renderer object.Applies only when
editable=false
.- Parameters:
renderer
- a renderer object
-
getAggregationProperties
- Returns:
- the list of properties names to prepopulate in vals area (gets passed to aggregator generating function)
-
setAggregationProperties
@StudioElementsGroup(xmlElement="aggregationProperties", caption="Aggregation Properties", icon="io/jmix/pivottable/icon/properties.svg", elementClass="io.jmix.pivottable.model.meta.NamedProperty") void setAggregationProperties(List<String> aggregationProperties) Sets the list of properties names to prepopulate in vals area (gets passed to aggregator generating function).Applies only when
editable=true
.- Parameters:
aggregationProperties
- a list of properties names
-
addAggregationProperties
Adds an array of properties names to prepopulate in vals area (gets passed to aggregator generating function).Applies only when
editable=true
.- Parameters:
aggregationProperties
- an array of properties names
-
getAggregations
Aggregations getAggregations()- Returns:
- the aggregations object which defines the collection of aggregations to use in pivot table and additional settings for them.
-
setAggregations
Sets the aggregations object which defines the collection of aggregations to use in pivot table and additional settings for them.Applies only when
editable=true
.- Parameters:
aggregations
- an aggregations object
-
getRenderers
Renderers getRenderers()- Returns:
- the renderers object which defines the collection of renderers to use in pivot table and additional settings for them.
-
setRenderers
@StudioElementsGroup(caption="Renderers", xmlElement="renderers", icon="io/jmix/pivottable/icon/component.svg", elementClass="io.jmix.pivottable.model.meta.Renderer") void setRenderers(Renderers renderers) Sets the renderers object which defines the collection of renderers to use in pivot table and additional settings for them.Applies only when
editable=true
.- Parameters:
renderers
- a renderers object
-
getHiddenProperties
- Returns:
- the list of properties names to omit from the UI
-
setHiddenProperties
@StudioElementsGroup(caption="Hidden Properties", xmlElement="hiddenProperties", icon="io/jmix/pivottable/icon/properties.svg", elementClass="io.jmix.pivottable.model.meta.NamedProperty") void setHiddenProperties(List<String> hiddenProperties) Sets the list of properties names to omit from the UI.Applies only when
editable=true
.- Parameters:
hiddenProperties
- a list of properties names
-
addHiddenProperties
Adds an array of properties names to omit from the UI.Applies only when
editable=true
.- Parameters:
hiddenProperties
- an array of properties names
-
getHiddenFromAggregations
- Returns:
- list of properties names to omit from the aggregation arguments dropdowns
-
setHiddenFromAggregations
@StudioElementsGroup(caption="Hidden from Aggregations", xmlElement="hiddenFromAggregations", icon="io/jmix/pivottable/icon/properties.svg", elementClass="io.jmix.pivottable.model.meta.NamedProperty") void setHiddenFromAggregations(List<String> hiddenFromAggregations) Sets the list of properties names to omit from the aggregation arguments dropdowns.Applies only when
editable=true
.- Parameters:
hiddenFromAggregations
- a list of properties names
-
addHiddenFromAggregations
Adds an array of properties names to omit from the aggregation arguments dropdowns.Applies only when
editable=true
.- Parameters:
hiddenFromAggregations
- an array of properties names
-
getHiddenFromDragDrop
- Returns:
- list of properties names to omit from the drag'n'drop portion of the UI
-
setHiddenFromDragDrop
@StudioElementsGroup(caption="Hidden from Drag&Drop", xmlElement="hiddenFromDragDrop", icon="io/jmix/pivottable/icon/properties.svg", elementClass="io.jmix.pivottable.model.meta.NamedProperty") void setHiddenFromDragDrop(List<String> hiddenFromDragDrop) Sets the list of properties names to omit from the drag'n'drop portion of the UI.Applies only when
editable=true
.- Parameters:
hiddenFromDragDrop
- a list of properties names
-
addHiddenFromDragDrop
Adds an array of properties names to omit from the drag'n'drop portion of the UI.Applies only when
editable=true
.- Parameters:
hiddenFromDragDrop
- an array of properties names
-
getColumnOrder
ColumnOrder getColumnOrder()- Returns:
- the order in which column data is provided to the renderer
-
setColumnOrder
Set the order in which column data is provided to the renderer.Ordering by value orders by column total.
- Parameters:
columnOrder
- the order in which column data is provided to the renderer
-
getRowOrder
RowOrder getRowOrder()- Returns:
- the order in which row data is provided to the renderer
-
setRowOrder
Sets the order in which row data is provided to the renderer.Ordering by value orders by row total.
- Parameters:
rowOrder
- the order in which row data is provided to the renderer
-
getMenuLimit
Integer getMenuLimit()- Returns:
- maximum number of values to list in the double-click menu
-
setMenuLimit
Sets maximum number of values to list in the double-click menu.Applies only when
editable=true
.- Parameters:
menuLimit
- maximum number of values to list in the double-click menu
-
getAutoSortUnusedProperties
Boolean getAutoSortUnusedProperties()- Returns:
true
if unused properties are kept sorted in the UI andfalse
otherwise
-
setAutoSortUnusedProperties
Controls whether or not unused properties are kept sorted in the UI.Applies only when
editable=true
.- Parameters:
autoSortUnusedProperties
-true
if unused properties are kept sorted in the UI andfalse
otherwise
-
getUnusedPropertiesVertical
UnusedPropertiesVertical getUnusedPropertiesVertical()- Returns:
true
if unused attributes are shown always vertical,false
if always horizontal. If set to a number (as is the default) then if the properties' names' combined length in characters exceeds the number then the properties will be shown vertically.
-
setUnusedPropertiesVertical
@StudioProperty(type=STRING) void setUnusedPropertiesVertical(UnusedPropertiesVertical unusedPropertiesVertical) Controls whether or not unused properties are shown vertically instead of the default which is horizontally.true
means always vertical,false
means always horizontal. If set to a number (as is the default) then if the properties' names' combined length in characters exceeds the number then the properties will be shown vertically.Applies only when
editable=true
.- Parameters:
unusedPropertiesVertical
- properties
-
getDataProvider
DataProvider getDataProvider()- Returns:
- data provider for PivotTable. Contains items which will be shown on PivotTable.
-
setDataProvider
Sets data provider for PivotTable. Contains items which will be shown on PivotTable.- Parameters:
dataProvider
- a data provider
-
addData
Adds a data item to data provider.- Parameters:
dataItems
- a data item to add
-
getFilterFunction
JsFunction getFilterFunction()- Returns:
- the
JsFunction
which defines a javascript code called on each record, returnsfalse
if the record is to be excluded from the input before rendering ortrue
otherwise
-
setFilterFunction
Sets theJsFunction
which defines a javascript code called on each record, returnsfalse
if the record is to be excluded from the input before rendering ortrue
otherwise- Parameters:
filter
- aJsFunction
to use as a filter
-
getSortersFunction
JsFunction getSortersFunction()- Returns:
- the
JsFunction
which defines a javascript code called with an property name and can return a function which can be used as an argument toArray.sort
for output purposes. If no function is returned, the default sorting mechanism is a built-in "natural sort" implementation. Useful for sorting attributes like month names
-
setSortersFunction
Sets theJsFunction
which defines a javascript code called with an property name and can return a function which can be used as an argument toArray.sort
for output purposes. If no function is returned, the default sorting mechanism is a built-in "natural sort" implementation. Useful for sorting attributes like month names- Parameters:
sorters
- aJsFunction
to use as a sorters
-
getRendererOptions
RendererOptions getRendererOptions()- Returns:
- the object passed through to renderer as options
-
setRendererOptions
Sets object passed through to renderer as options.- Parameters:
rendererOptions
- object defines renderer options
-
getInclusions
- Returns:
- map whose keys are properties names and values are lists of properties values which denote records to include in rendering; used to prepopulate the filter menus that appear on double-click
-
setInclusions
@StudioElementsGroup(xmlElement="inclusions", caption="Inclusions", icon="io/jmix/pivottable/icon/component.svg", elementClass="io.jmix.pivottable.model.meta.NamedPropertyWithValues") void setInclusions(Map<String, List<String>> inclusions) Sets map whose keys are properties names and values are lists of properties values which denote records to include in rendering; used to prepopulate the filter menus that appear on double-click (overridesexclusions
).Applies only when
editable=true
.- Parameters:
inclusions
- map with properties and values included in rendering- See Also:
-
setInclusions
Sets the value of inclusions map.- Parameters:
property
- property nameinclusions
- a list of properties values- See Also:
-
addInclusions
Adds a values to given key of inclusions map.- Parameters:
property
- a property nameinclusions
- an array of properties values- See Also:
-
getExclusions
- Returns:
- map whose keys are properties names and values are lists of properties values which denote records to exclude from rendering; used to prepopulate the filter menus that appear on double-click
-
setExclusions
@StudioElementsGroup(xmlElement="exclusions", caption="Exclusions", icon="io/jmix/pivottable/icon/component.svg", elementClass="io.jmix.pivottable.model.meta.NamedPropertyWithValues") void setExclusions(Map<String, List<String>> exclusions) Sets map whose keys are properties names and values are lists of properties values which denote records to exclude from rendering; used to prepopulate the filter menus that appear on double-click.Applies only when
editable=true
.- Parameters:
exclusions
- map with properties and values excluded from rendering- See Also:
-
setExclusions
Sets the value of exclusions map.- Parameters:
property
- property nameexclusions
- a list of properties values- See Also:
-
addExclusions
Adds a values to given key of exclusions map.- Parameters:
property
- a property nameexclusions
- an array of properties values- See Also:
-
getDerivedProperties
DerivedProperties getDerivedProperties()- Returns:
- object to define derived properties
-
setDerivedProperties
@StudioElementsGroup(caption="Derived Properties", xmlElement="derivedProperties", icon="io/jmix/pivottable/icon/properties.svg", elementClass="io.jmix.pivottable.model.meta.DerivedProperty") void setDerivedProperties(DerivedProperties derivedProperties) Sets object to define derived properties.- Parameters:
derivedProperties
- object to define derived properties
-
setNativeJson
Set additional JSON configuration as a string. This JSON can override configuration loaded from XML and from Component API.- Parameters:
json
- additional JSON configuration
-
getNativeJson
String getNativeJson()- Returns:
- additional JSON configuration as a string.
-
getEmptyDataMessage
String getEmptyDataMessage()- Returns:
- the message that will be displayed in case of empty data
-
setShowUI
Hides or shows UI elements in the editable pivot table.true
by default.
Applies only wheneditable=true
.- Parameters:
showUI
-true
if UI elements should be shown andfalse
otherwise
-
isShowUI
Boolean isShowUI()- Returns:
true
ifpivotUI()
should be shown andfalse
otherwise
-
setShowRowTotals
Setfalse
if row totals shouldn't be shown andtrue
otherwise. Works only for table renderers.true
by default.- Parameters:
showRowTotals
-false
if row totals shouldn't be shown andtrue
otherwise
-
isRowTotalsShown
Boolean isRowTotalsShown()- Returns:
false
if row totals shouldn't be shown andtrue
otherwise
-
setShowColTotals
Setfalse
if col totals shouldn't be shown andtrue
otherwise. Works only for table renderers.true
by default.- Parameters:
showColTotals
-false
if col totals shouldn't be shown andtrue
otherwise
-
isColTotalsShown
Boolean isColTotalsShown()- Returns:
false
if col totals shouldn't be shown andtrue
otherwise
-
setEmptyDataMessage
Sets the message that will be displayed in case of empty data.- Parameters:
emptyDataMessage
- the message that will be displayed in case of empty data
-
addRefreshListener
Adds a listener to the pivot table refresh events. Fired only for editable PivotTable.- Parameters:
refreshListener
- a listener to add- Returns:
- subscription
-
addCellClickListener
Adds a listener to the pivot table cell click events. Fired only for table renderers (table, heatmap, table barchart, col heatmap, row heatmap).- Parameters:
listener
- a listener to add- Returns:
- subscription
-