Package io.jmix.pivottable.component
Interface PivotTable
- All Superinterfaces:
Component,Component.BelongToFrame,Component.Editable,Component.HasCaption,Component.HasDescription
- All Known Implementing Classes:
PivotTableImpl
public interface PivotTable
extends Component, Component.BelongToFrame, Component.Editable, Component.HasCaption
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classDescribes PivotTable cell click event.static classDescribes 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
FieldsFields inherited from interface io.jmix.ui.component.Component
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAggregationProperties(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.voidaddColumns(String... cols) Adds an array of property names to use as columns.voidAdds a data item to data provider.voidaddExclusions(String property, String... exclusions) Adds a values to given key of exclusions map.voidaddHiddenFromAggregations(String... hiddenFromAggregations) Adds an array of properties names to omit from the aggregation arguments dropdowns.voidaddHiddenFromDragDrop(String... hiddenFromDragDrop) Adds an array of properties names to omit from the drag'n'drop portion of the UI.voidaddHiddenProperties(String... hiddenProperties) Adds an array of properties names to omit from the UI.voidaddInclusions(String property, String... inclusions) Adds a values to given key of inclusions map.voidaddProperties(Map<String, String> properties) Adds a map whose keys areDataItemproperty names to use as pivot table data and values they localized names.voidaddProperty(String property, String value) Add a property eith its localized valueaddRefreshListener(Consumer<PivotTable.RefreshEvent> refreshListener) Adds a listener to the pivot table refresh events.voidAdds an array of properties names to use as rows.getRows()isShowUI()voidrepaint()Resend all items and properties to client and repaint pivot table.voidsetAggregation(Aggregation aggregation) Sets the aggregation object.voidsetAggregationProperties(List<String> aggregationProperties) Sets the list of properties names to prepopulate in vals area (gets passed to aggregator generating function).voidsetAggregations(Aggregations aggregations) Sets the aggregations object which defines the collection of aggregations to use in pivot table and additional settings for them.voidsetAutoSortUnusedProperties(Boolean autoSortUnusedProperties) Controls whether or not unused properties are kept sorted in the UI.voidsetColumnOrder(ColumnOrder columnOrder) Set the order in which column data is provided to the renderer.voidsetColumns(List<String> cols) Sets the list of property names to use as columns.voidsetDataProvider(DataProvider dataProvider) Sets data provider for PivotTable.voidsetDerivedProperties(DerivedProperties derivedProperties) Sets object to define derived properties.voidsetEmptyDataMessage(String emptyDataMessage) Sets the message that will be displayed in case of empty data.voidsetExclusions(String property, List<String> exclusions) Sets the value of exclusions map.voidsetExclusions(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.voidsetFilterFunction(JsFunction filter) Sets theJsFunctionwhich defines a javascript code called on each record, returnsfalseif the record is to be excluded from the input before rendering ortrueotherwisevoidsetHiddenFromAggregations(List<String> hiddenFromAggregations) Sets the list of properties names to omit from the aggregation arguments dropdowns.voidsetHiddenFromDragDrop(List<String> hiddenFromDragDrop) Sets the list of properties names to omit from the drag'n'drop portion of the UI.voidsetHiddenProperties(List<String> hiddenProperties) Sets the list of properties names to omit from the UI.voidsetInclusions(String property, List<String> inclusions) Sets the value of inclusions map.voidsetInclusions(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).voidsetMenuLimit(Integer menuLimit) Sets maximum number of values to list in the double-click menu.voidsetNativeJson(String json) Set additional JSON configuration as a string.voidsetProperties(Map<String, String> properties) Sets the map whose keys areDataItemproperty names to use as pivot table data and values they localized names.voidsetRenderer(Renderer renderer) Sets the renderer object.voidsetRendererOptions(RendererOptions rendererOptions) Sets object passed through to renderer as options.voidsetRenderers(Renderers renderers) Sets the renderers object which defines the collection of renderers to use in pivot table and additional settings for them.voidsetRowOrder(RowOrder rowOrder) Sets the order in which row data is provided to the renderer.voidSets the list of properties names to use as rows.voidsetShowColTotals(Boolean showColTotals) Setfalseif col totals shouldn't be shown andtrueotherwise.voidsetShowRowTotals(Boolean showRowTotals) Setfalseif row totals shouldn't be shown andtrueotherwise.voidHides or shows UI elements in the editable pivot table.voidsetSortersFunction(JsFunction sorters) Sets theJsFunctionwhich defines a javascript code called with an property name and can return a function which can be used as an argument toArray.sortfor output purposes.voidsetUnusedPropertiesVertical(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, withUnwrappedCompositionMethods inherited from interface io.jmix.ui.component.Component.BelongToFrame
getFrame, setFrameMethods inherited from interface io.jmix.ui.component.Component.Editable
isEditable, isEditableWithParent, setEditableMethods inherited from interface io.jmix.ui.component.Component.HasCaption
getCaption, setCaptionMethods 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
DataItemproperty names to use as pivot table data and values they localized names
-
setProperties
Sets the map whose keys areDataItemproperty 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 areDataItemproperty 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 eith its localized value- Parameters:
property- property namevalue- localized value
-
getRows
- Returns:
- the list of properties names to use as rows.
-
setRows
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
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
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
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
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
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
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:
trueif unused properties are kept sorted in the UI andfalseotherwise
-
setAutoSortUnusedProperties
Controls whether or not unused properties are kept sorted in the UI.Applies only when
editable=true.- Parameters:
autoSortUnusedProperties-trueif unused properties are kept sorted in the UI andfalseotherwise
-
getUnusedPropertiesVertical
UnusedPropertiesVertical getUnusedPropertiesVertical()- Returns:
trueif unused attributes are shown always vertical,falseif 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
Controls whether or not unused properties are shown vertically instead of the default which is horizontally.truemeans always vertical,falsemeans 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
JsFunctionwhich defines a javascript code called on each record, returnsfalseif the record is to be excluded from the input before rendering ortrueotherwise
-
setFilterFunction
Sets theJsFunctionwhich defines a javascript code called on each record, returnsfalseif the record is to be excluded from the input before rendering ortrueotherwise- Parameters:
filter- aJsFunctionto use as a filter
-
getSortersFunction
JsFunction getSortersFunction()- Returns:
- the
JsFunctionwhich defines a javascript code called with an property name and can return a function which can be used as an argument toArray.sortfor 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 theJsFunctionwhich defines a javascript code called with an property name and can return a function which can be used as an argument toArray.sortfor 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- aJsFunctionto 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
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
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
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.trueby default.
Applies only wheneditable=true.- Parameters:
showUI-trueif UI elements should be shown andfalseotherwise
-
isShowUI
Boolean isShowUI()- Returns:
trueifpivotUI()should be shown andfalseotherwise
-
setShowRowTotals
Setfalseif row totals shouldn't be shown andtrueotherwise. Works only for table renderers.trueby default.- Parameters:
showRowTotals-falseif row totals shouldn't be shown andtrueotherwise
-
isRowTotalsShown
Boolean isRowTotalsShown()- Returns:
falseif row totals shouldn't be shown andtrueotherwise
-
setShowColTotals
Setfalseif col totals shouldn't be shown andtrueotherwise. Works only for table renderers.trueby default.- Parameters:
showColTotals-falseif col totals shouldn't be shown andtrueotherwise
-
isColTotalsShown
Boolean isColTotalsShown()- Returns:
falseif col totals shouldn't be shown andtrueotherwise
-
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
-