Class: FormatAppearances

FormatAppearances(oPivot)

new FormatAppearances(oPivot)

The FormatAppearances object holds the formats to apply on the pivot control. For instance, you can change the visual-appearance for all values to show within a pivot column. The FormatAppearances / GetFormatAppearances() method returns the control's format-appearances that defines the visual-appearance to apply on pivot-columns.

By default, the FormatAppearances collection contains the following objects:

  • "bold", to show the cells in bold
  • "italic", to show the cells in italics
  • "strikeout", to show the cells as strikeout
  • "underline", to underline the cells
Parameters:
Name Type Description
oPivot Pivot Indicates an object of Pivot type that owns the collection
Example
oPivot.FormatAppearances.Add({key: "blue", shape: {fillColor: "rgba(0,0,255,0.5)"}}), adds "blue" to the control's format-appearances (right-click the control to show it), to show the cell's background in blue
 oPivot.FormatAppearances.Add({key: "border", shape: {frameColor: "red"}}), adds "border" to the control's format-appearances (right-click the control to show it), to show a red-border arround the cell
 oPivot.FormatAppearances.Add({key: "button", shape: "Button"}), adds "button" to the control's format-appearances (right-click the control to show it), to show the cells as buttons

Methods

Add(oFormatOptions) → {FormatOptions}

The Add() method adds/updates the format based on its key
Parameters:
Name Type Description
oFormatOptions object Indicates an object of FormatOptions type that holds attributes of the format to add/replace
Returns:
Returns undefined (no key provided), or an the object being added of FormatOptions type that holds attributes of the format being added
Type
FormatOptions

Clear()

The Clear() method clears the FormatOptions objects within the collection

forEach(callback, thisArg)

The forEach() method enumerates the FormatOptions objects within the current collection
Parameters:
Name Type Description
callback callback Indicates a function of callback(oFormatOptions) type, where
oFormatOptions {object}, indicates the format of FormatOptions type
thisArg any Specifies the value of "this" keyword during the callback. If missing it refers to the current collection.

GetCount() → {number}

The GetCount() method returns the number of FormatOptions objects within the collection
Returns:
Returns the number of FormatAppearances within the collection
Type
number

Item(key) → {FormatOptions}

The Item() property gets the format based on the key
Parameters:
Name Type Description
key string Specifies the key of the format to request
Returns:
Returns undefined (no format found), or an the object being added of FormatOptions type that holds attributes of the format being added
Type
FormatOptions

Remove(key) → {boolean}

The Remove() method removes the format giving its key
Parameters:
Name Type Description
key string Specifies the key of the format to remove
Returns:
Returns true, if the key has been removed
Type
boolean