Interface PivotTable

All Superinterfaces:
Component, Component.BelongToFrame, Component.Editable, Component.HasCaption, Component.HasDescription
All Known Implementing Classes:
PivotTableImpl

  • Field Details

  • 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

      Map<String,String> getProperties()
      Returns:
      the map whose keys are DataItem property names to use as pivot table data and values they localized names
    • setProperties

      void setProperties(Map<String,String> properties)
      Sets the map whose keys are DataItem property names to use as pivot table data and values they localized names.
      Parameters:
      properties - a map of properties names with localized values
    • addProperties

      void addProperties(Map<String,String> properties)
      Adds a map whose keys are DataItem property names to use as pivot table data and values they localized names.
      Parameters:
      properties - a map of properties names with localized values
    • addProperty

      void addProperty(String property, String value)
      Add a property eith its localized value
      Parameters:
      property - property name
      value - localized value
    • getRows

      List<String> getRows()
      Returns:
      the list of properties names to use as rows.
    • setRows

      void setRows(List<String> rows)
      Sets the list of properties names to use as rows.
      Parameters:
      rows - a list of properties names
    • addRows

      void addRows(String... rows)
      Adds an array of properties names to use as rows.
      Parameters:
      rows - an array of properties names
    • getColumns

      List<String> getColumns()
      Returns:
      the list of property names to use as columns.
    • setColumns

      void setColumns(List<String> cols)
      Sets the list of property names to use as columns.
      Parameters:
      cols - a list of properties names
    • addColumns

      void addColumns(String... cols)
      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

      void setAggregation(Aggregation aggregation)
      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

      void setRenderer(Renderer renderer)
      Sets the renderer object.

      Applies only when editable=false.

      Parameters:
      renderer - a renderer object
    • getAggregationProperties

      List<String> getAggregationProperties()
      Returns:
      the list of properties names to prepopulate in vals area (gets passed to aggregator generating function)
    • setAggregationProperties

      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

      void addAggregationProperties(String... aggregationProperties)
      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

      void setAggregations(Aggregations aggregations)
      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

      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

      List<String> getHiddenProperties()
      Returns:
      the list of properties names to omit from the UI
    • setHiddenProperties

      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

      void addHiddenProperties(String... hiddenProperties)
      Adds an array of properties names to omit from the UI.

      Applies only when editable=true.

      Parameters:
      hiddenProperties - an array of properties names
    • getHiddenFromAggregations

      List<String> getHiddenFromAggregations()
      Returns:
      list of properties names to omit from the aggregation arguments dropdowns
    • setHiddenFromAggregations

      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

      void addHiddenFromAggregations(String... hiddenFromAggregations)
      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

      List<String> getHiddenFromDragDrop()
      Returns:
      list of properties names to omit from the drag'n'drop portion of the UI
    • setHiddenFromDragDrop

      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

      void addHiddenFromDragDrop(String... hiddenFromDragDrop)
      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

      void setColumnOrder(ColumnOrder columnOrder)
      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

      void setRowOrder(RowOrder rowOrder)
      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

      void setMenuLimit(Integer menuLimit)
      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 and false otherwise
    • setAutoSortUnusedProperties

      void setAutoSortUnusedProperties(Boolean autoSortUnusedProperties)
      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 and false 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

      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

      void setDataProvider(DataProvider dataProvider)
      Sets data provider for PivotTable. Contains items which will be shown on PivotTable.
      Parameters:
      dataProvider - a data provider
    • addData

      void addData(DataItem... dataItems)
      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, returns false if the record is to be excluded from the input before rendering or true otherwise
    • setFilterFunction

      void setFilterFunction(JsFunction filter)
      Sets the JsFunction which defines a javascript code called on each record, returns false if the record is to be excluded from the input before rendering or true otherwise
      Parameters:
      filter - a JsFunction 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 to Array.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

      void setSortersFunction(JsFunction sorters)
      Sets the JsFunction which defines a javascript code called with an property name and can return a function which can be used as an argument to Array.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 - a JsFunction to use as a sorters
    • getRendererOptions

      RendererOptions getRendererOptions()
      Returns:
      the object passed through to renderer as options
    • setRendererOptions

      void setRendererOptions(RendererOptions rendererOptions)
      Sets object passed through to renderer as options.
      Parameters:
      rendererOptions - object defines renderer options
    • getInclusions

      Map<String,List<String>> 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

      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 (overrides exclusions).

      Applies only when editable=true.

      Parameters:
      inclusions - map with properties and values included in rendering
      See Also:
    • setInclusions

      void setInclusions(String property, List<String> inclusions)
      Sets the value of inclusions map.
      Parameters:
      property - property name
      inclusions - a list of properties values
      See Also:
    • addInclusions

      void addInclusions(String property, String... inclusions)
      Adds a values to given key of inclusions map.
      Parameters:
      property - a property name
      inclusions - an array of properties values
      See Also:
    • getExclusions

      Map<String,List<String>> 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

      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

      void setExclusions(String property, List<String> exclusions)
      Sets the value of exclusions map.
      Parameters:
      property - property name
      exclusions - a list of properties values
      See Also:
    • addExclusions

      void addExclusions(String property, String... exclusions)
      Adds a values to given key of exclusions map.
      Parameters:
      property - a property name
      exclusions - an array of properties values
      See Also:
    • getDerivedProperties

      DerivedProperties getDerivedProperties()
      Returns:
      object to define derived properties
    • setDerivedProperties

      void setDerivedProperties(DerivedProperties derivedProperties)
      Sets object to define derived properties.
      Parameters:
      derivedProperties - object to define derived properties
    • setNativeJson

      void setNativeJson(String json)
      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

      void setShowUI(Boolean showUI)
      Hides or shows UI elements in the editable pivot table. true by default.
      Applies only when editable=true.
      Parameters:
      showUI - true if UI elements should be shown and false otherwise
    • isShowUI

      Boolean isShowUI()
      Returns:
      true if pivotUI() should be shown and false otherwise
    • setShowRowTotals

      void setShowRowTotals(Boolean showRowTotals)
      Set false if row totals shouldn't be shown and true otherwise. Works only for table renderers. true by default.
      Parameters:
      showRowTotals - false if row totals shouldn't be shown and true otherwise
    • isRowTotalsShown

      Boolean isRowTotalsShown()
      Returns:
      false if row totals shouldn't be shown and true otherwise
    • setShowColTotals

      void setShowColTotals(Boolean showColTotals)
      Set false if col totals shouldn't be shown and true otherwise. Works only for table renderers. true by default.
      Parameters:
      showColTotals - false if col totals shouldn't be shown and true otherwise
    • isColTotalsShown

      Boolean isColTotalsShown()
      Returns:
      false if col totals shouldn't be shown and true otherwise
    • setEmptyDataMessage

      void setEmptyDataMessage(String emptyDataMessage)
      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

      Subscription addRefreshListener(Consumer<PivotTable.RefreshEvent> refreshListener)
      Adds a listener to the pivot table refresh events. Fired only for editable PivotTable.
      Parameters:
      refreshListener - a listener to add
      Returns:
      subscription
    • addCellClickListener

      Subscription addCellClickListener(Consumer<PivotTable.CellClickEvent> listener)
      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