Pivot class

Pivot(client, oOptionsopt)

new Pivot(client, oOptionsopt)

The ExPivot/JS is our approach to provide data summarization, as a pivot table. A pivot-table can automatically sort, count, total or give the average of the data stored in one table or spreadsheet. The user sets up and changes the summary's structure by dragging and dropping fields graphically. The ExPivot/JS is a HTML standalone-component, written in JavaScript, that uses no third-party libraries.
The ExPivot/JS component supports/inherits all objects, properties, members, methods and events of the ExTree/JS component.

Every option of the exontrol.Tree.Options or Pivot.Options type has associated a property of the control. For instance, the option:

allowActions {string}, customizes the actions the user can perform once the user clicks or touches the control
is associated with the property:
AllowActions {string}, customizes the actions the user can perform once the user clicks or touches the control
which means that the following statements are equivalent:
oPivot.Options = {allowActions: "scroll"}
oPivot.SetOptions({allowActions: "scroll"})
oPivot.AllowActions = "scroll"
oPivot.SetAllowActions("scroll")
where oPivot is an object of Pivot type
Parameters:
Name Type Attributes Description
client any The client parameter indicates the control's client area as:
  • array of [x,y,width,height] type that specifies the control's client area
  • string, that specifies the identifier of the canvas within the document, so the canvas's client area becomes the control's client area
  • HTMLCanvasElement, that specifies the identifier of the canvas within the document, so the canvas's client area becomes the control's client area
oOptions object <optional>
An object of exontrol.Tree.Options type that defines different options to display the control. Additionally, it supports all fields of Pivot.Options class.
Requires:
  • module:exontrol.commmon.min.js
  • module:exontrol.tree.min.js
  • module:exontrol.menu.min.js
Pivot

Requires

  • module:exontrol.commmon.min.js
  • module:exontrol.tree.min.js
  • module:exontrol.menu.min.js

Classes

Options

Members

(static, readonly) PivotBarVisibleEnum :number

The Pivot.PivotBarVisibleEnum type specifies options/flags/properties of the control's pivot bar.
Type:
  • number
Properties:
Name value Type Description
exPivotBarHidden 0 number The control's pivot bar is hidden.
exPivotBarVisible 1 number The control's pivot bar is visible. Include or exclude this flag to show or hide the control's pivot bar.
exPivotBarSizable 2 number The pivot bar is sizable. Include or exclude this flag to allow or prevent resizing the pivot bar at runtime. If this flag is present, the user can resize the pivot bar by dragging the bottom side of the control. The resize cursor is shown when the pivot bar is resizable and cursor hovers the bottom side of the pivot bar.
exPivotBarFloat 4 number The pivot bar is shown into a floating window. Include this flag, to display the control's pivot bar to a separate window (a floating panel)
exPivotBarAutoFit 8 number The pivot bar's height is updated automatically so all elements fits the client area (When this flag is present, the height of the pivot's bar is automatically adjusted so the entire content fits the header).
exPivotBarShowTotals 16 number The pivot bar shows the total/sub-total fields. Include or exclude this flag to show or hide the Total field in the pivot bar.
exPivotBarAutoHide 32 number Shows the pivotbar as soon as the cursor hovers it, and hides it as soon as the cursor leaves it
exPivotBarAllowValues 64 number Specifies if the user can drop values of the columns to the pivot bar.
exPivotBarAllowFormatAppearance 128 number Specifies if the user can select a different appearance for columns or total/subtotal fields.
exPivotBarAllowFormatConditionalAppearance 16777216 number Specifies if the user can select conditional appearance for columns.
exPivotBarAllowFormatContent 256 number Specifies if the user can select the way the column's data is displayed.
exPivotBarAutoUpdate 512 number Indicates whether the control' list is automatically updated once the user drops objects in the pivot bar.
exPivotBarAllowUndoRedo 1024 number Indicates if the pivot bar allows Undo/Redo operations, if the user presses the CTRL+Z/Y. The control restores the previously layout once the user presses the CTRL + Z keys combination. The control restores the next layout once the user presses the CTRL + Y keys combination. Exclude this flag, and the Undo/Redo feature is disabled.
exPivotBarAllowResizeColumns 2048 number Indicates if the user can resize the columns in the pivot bar. This flag affects the columns to be displayed of the pivot bar, not the columns to be displayed in the control's list.
exPivotBarHideAddNew 4096 number Prevents showing the add new buttons in the pivot bar. Clicking the Add New button displays a list of columns or aggregate functions that can be added in the current context.
exPivotBarContextSortAscending 65536 number Shows the columns alphabetically in ascending order. This flag can be combined with exPivotBarContextSortReverse and so, the columns will be alphabetically displayed in descending order.
exPivotBarContextSortReverse 1048576 number Shows the columns in reverse order. This flag can be combined with exPivotBarContextSortAscending and so, the columns will be alphabetically displayed in descending order.
exPivotBarReadOnly 268435456 number Makes the pivot bar read only, so no changes are allowed.

(static) type :string

The type field defines the full-name of the object (the constructor.name does not give the same name for minimized forms). The Pivot.type member always returns "Pivot"
Type:
  • string
Since:
  • 1.8

(static) version :string

The version field defines the version of the control. The current version is 3.0
Type:
  • string

Methods

BeginUpdate()

The BeginUpdate() method suspends the control's render until the EndUpdate() method is called. It maintains performance, while multiple changes occurs within the control. You can use the Update() method to perform multiple changes at once.
BeginUpdate

EndUpdate()

The EndUpdate() method resumes the control's render, after it is suspended by the BeginUpdate() method.
EndUpdate

GetCanvas() → {HTMLCanvasElement}

The GetCanvas() method returns the HTMLCanvasElement object where the control is currently running on. For instance, the control can change the cursor shape during the control's onmousemove, and so on.
Since:
  • 1.8
Returns:
Returns the HTMLCanvasElement object where the control is currently running on. For instance, the control can change the cursor shape during the control's onmousemove, and so on.
Type
HTMLCanvasElement
GetCanvas

GetFormatAppearances() → {FormatAppearances}

The GetFormatAppearances() method returns the control's format-appearances that defines the visual-appearance to apply on pivot-columns
Returns:
Returns an object of Pivot.FormatAppearances type, that holds the control's format-appearances
Type
FormatAppearances
GetFormatAppearances

GetFormatConditionalAppearances() → {FormatConditionalAppearances}

The GetFormatConditionalAppearances() method returns the control's format-appearances that defines the visual-appearance to apply on pivot-columns, based on conditions
Returns:
Returns an object of Pivot.FormatConditionalAppearances type, that holds the control's format-appearances
Type
FormatConditionalAppearances
GetFormatConditionalAppearances

GetFormatContents() → {FormatContents}

The GetFormatContents() method returns the control's format-contents that specifies how a column or row can be displayed, formatted or converted.
Returns:
Returns an object of Pivot.FormatContents type, that holds information about how a column or row can be displayed, formatted or converted.
Type
FormatContents
GetFormatContents

GetRun() → {Pivot}

The GetRun() method returns the runtime-pivot
Returns:
Returns an object of Pivot type, that displays the generated pivot rows and columns
Type
Pivot
GetRun

Update(callback, thisArgopt)

The Update() method locks the control's paint during the callback, and invalidates the control once the method ends.
Parameters:
Name Type Attributes Description
callback callback Indicates a callback to perform changes within the control
thisArg any <optional>
Specifies the value of "this" keyword during the callback. If missing/empty/undefined the thisArg points to the control itself, as an object of Pivot type
Update

Events

ondolayout

The ondolayout() method occurs once the pivot's layout is ready (the control's content has been re-generated/formatted, after pivotRows, pivotColumns or pivotTotals property has been changed)
Example
The following samples display a message once the pivot's layout (columns, rows or totals) has been changed:

oPivot.ondolayout = function )
{
 console.log("the layout has been changed");
}

or

oPivot.Listeners.Add("ondolayout", function ()
{
 console.log("the layout has been changed");
})

where oPivot is an object of Pivot type
ondolayout