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 formatis associated with the property:
Expression {string}, specifies the condition of the conditional formatwhich means that the following statements are equivalent:
oConditionalFormat.Options = {expression: "%0 >= 0"}where oConditionalFormat is an object of ConditionalFormat type
oConditionalFormat.SetOptions({expression: "%0 >= 0"})
oConditionalFormat.Expression = "%0 >= 0"
oConditionalFormat.Setexpression("%0 >= 0")
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
applyTo
(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
enabled
(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/evaluatedThe expression supports the following variables:
%0, %1, %2, ... {any} specifies the value of the cell in the column with the index 0, 1 2, ... ( "currency(%0 + %1)", adds the value of first and second cell and displays it as a currency )The expression supports the following functions:
%C0, %C1, %C2, ... {string} specifies the caption of the cell, or the string the cell displays in the column with the index 0, 1 2, ... ( "%C0 + %C1", concatenates the caption of first and second cell )
%CD0, %CD1, %CD2, ... {any} specifies the cell's user-date in the column with the index 0, 1 2, ... ( "%CD0 ? value : ``", displays the cell's value only if the cell's data is not empty )
%CS0, %CS1, %CS2, ... {number} specifies the cell's state in the column with the index 0, 1 2, ... ( "(%CS0 ? `<b>` : ``) + value", displays the cell's value in bold only if the first cell is checked )
%CT0, %CT1, %CT2, ... {boolean} returns true if the cell displays a total field; otherwise, it returns false. The exTotalField / exTotalColumn flag specifies whether the cell displays a total field. For instance, "%CT1" refers to all cells in the second column that display totals, while "not %CT1" refers to all cells in the second column that do not display totals (@since 3.3)
%CE0, %CE1, %CE2, ... {boolean} returns true if the cell is editable; otherwise, it returns false.. For example, "%CE0" refers to all editable cells in the first column, while "not %CE1" refers to all cells in the second column that are read-only (@since 3.3)
%CC0, %CC1, %CC2, ... {number} retrieve the number of child items (this keyword consistently returns identical results for all cells since it pertains to the item that hosts each cell). The ChildCount property returns the number of child items. For example, "%CC0" identifies all parent items, while "%CC0 = 0" identifies all leaf items (@since 3.3)
%CX0, %CX1, %CX2, ... {boolean} returns true if the item hosting the cell is expanded, or false if it is collapsed (this keyword consistently returns identical results for all cells since it pertains to the item that hosts each cell). The ExpandItem property specifically indicates whether the item is expanded or collapsed. For example, "%CX0" refers to all expanded items, while "not %CX0" identifies all collapsed items (@since 3.3)
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
expression
(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.
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
shape