Class: ConditionalFormatOptions

ConditionalFormatOptions()

new ConditionalFormatOptions()

The ConditionalFormatOptions type holds all options a ConditionalFormat can display or own

Every option of the ConditionalFormatOptions type has associated a property of the ConditionalFormat object. For instance, the option:

expression {string}, specifies the condition of the conditional format
is associated with the property:
Expression {string}, specifies the condition of the conditional format
which means that the following statements are equivalent:
oConditionalFormat.Options = {expression: "%0 >= 0"}
oConditionalFormat.SetOptions({expression: "%0 >= 0"})
oConditionalFormat.Expression = "%0 >= 0"
oConditionalFormat.Setexpression("%0 >= 0")
where oConditionalFormat is an object of ConditionalFormat type

Members

(static) applyTo :any

The applyTo field specifies whether the conditional format is applied to items or to columns
Type:
  • any
Example
null{null} or -1 {number}, the format is applied to items (negative-number)
 0 {number}, the format is applied to all cells of the conditional format with the index 0 that verify the condition
 "C1,C2" {string}, the format is applied to all cells of the columns "C1" and "C2" that verify the condition

(static) enabled :boolean

The enabled field indicates whether the condition is enabled or disabled (no format or shape is applied if the condition is invalid or disabled)
Type:
  • boolean
Example
false {boolean}, disables the condition (no format or shape is applied if the condition is invalid or disabled)
 true {boolean}, enables the condition

(static) expression :string

The expression field specifies the condition of the conditional format (no format or shape is applied if the condition is invalid or disabled) The expression supports the following keywords:
value, gets the value of the cell being formatted/evaluated
The expression supports the following variables:
%0, %1, %2, ... specifies the value of the cell in the conditional format with the index 0, 1 2, ...
%C0, %C1, %C2, ... specifies the caption of the cell, or the string the cell displays in the conditional format with the index 0, 1 2, ...
%CD0, %CD1, %CD2, ... specifies the cell's user-date in the conditional format with the index 0, 1 2, ...
%CS0, %CS1, %CS2, ... specifies the cell's state in the conditional format with the index 0, 1 2, ...
The expression supports the following functions:
index, gets the index of the item
rindex, returns the recursive-index of the item
pos, returns the relative position of the item (the position within the parent's children collection)
rpos, returns the recursive relative-position of the item (the position within the parent's children collection)
opos, returns the relative old position of the item (the position within the parent's children collection)
ropos, returns the recursive relative-old-position of the item (the position within the parent's children collection)
apos, returns the absolute position of the item (the position from the first visible item)
rapos, returns the recursive absolute-position of the item (the position from the first visible item)
Type:
  • string
Example
"1" {string}, highlights all cells or items.
 "%0 >= 0" {string}, highlights the cells or items, when the cells in the first conditional format have the value greater or equal with zero
 "%0 startwith 'A'" {string}, highlights the cells or items, when the cells in the first column starts with A

(static) key :string

The key field specifies the key associated with the conditional format.
Type:
  • string
Example
"cond" {string}, defines the conditional format with the giving key (cond). You can use the ConditionalFormats.Item("cond") method to request the conditional format giving its key.

(static) shape :any

The shape field defines the shape to apply on the cell / column if the condition is verified The shape field can be any of the following:
  • the shape's name within the exontrol.Shape.Tree or exontrol.Shape namespace
  • a CSS color
  • a JSON string-representation of an object of exontrol.Def.Shape type, for the column itself
  • an object of {normal,hover,click,disabled} type. The normal, hover, click and disabled are objects of exontrol.Def.Shape type
Type:
  • any
Example
"" {string}, null {null}, no shape is applied
 "red" {string}, fills the object's background in red (CSS color)
 '{"fillColor": "red"}' or '{"normal":{"fillColor": "red"}}' {string}, fills the object's background in red (JSON-representation of an object of exontrol.Def.Shape type)
 "xxx" {string}, indicates that exontrol.Shapes.Tree.xxx or exontrol.Shapes.xxx is applied on the object's background. If the xxx field is missing, no custom shape is applied (no default object's shape is be applied)
 exontrol.Shapes.Button {object}, applies the "Button" shape on the object as defined into exontrol.Shapes namespace