Class: CellOptions

CellOptions()

new CellOptions()

The CellOptions type holds all options a Cell can display or own.

Every option of the CellOptions type has associated a property of the Cell object. For instance, the option:

cursor {string}, defines the mouse-cursor for individual cell
is associated with the property:
Cursor {string}, defines the mouse-cursor for individual cell
which means that the following statements are equivalent:
oCell.Options = {cursor: "pointer"}
oCell.SetOptions({cursor: "pointer"})
oCell.Cursor = "pointer"
oCell.SetCursor("pointer")
where oCell is an object of Cell type

Members

(static) cursor :string

The cursor field defines the mouse-cursor for individual cell.
Type:
  • string
Example
"pointer" {string}, The cursor is a pointer that indicates a link (typically an image of a pointing hand)

(static) data :any

The data field associates any extra data to the current cell (can be requested within format-expression using the %CD syntax)
Type:
  • any
Example
0 {number}, the cell's data is 0. For instance, "%CD0 == 0" format-expression selects all cells with the cell's data on 0
 "name" {string}, the cell's data is "name". For instance, "%CD0 like `name*`" format-expression selects all cells with the cell's data starting with "name"

(static) enabled :boolean

The enabled field indicates whether the cell is enabled or disabled
Type:
  • boolean
Example
false {boolean}, disables the cell
 true {boolean}, enables the cell

(static) format :string

The format field specifies the expression to format the cell The format-expression supports the following keywords:
value, indicates the value of the current cell ( "value/2 format ``", displays half of the value using current regional format )
%0, %1, %2, ... 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 )
%C0, %C1, %C2, ... 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, ... 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, ... 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 )
The format-expression supports the following unary-operators:
  • exp(``), checks whether the item is expanded or collapsed ( "(exp(``) ? `<b>` : ``) + value", shows expanded-items in bold )
  • get(`aggregate(list,direction,formula)`), summarizes the cell based on "aggregate(list,direction,formula)" syntax, where:
    aggregate, must be one of the following:
    • sum, performs addition of values
    • min, retrieves the minimum value
    • max, retrieves the maximum value
    • count, counts the number of items
    • avg, calculates the average of values
    • std, gets standard-deviation of numbers
    list, must be one of the following:
    • a number expression that specifies the index of the item being referred
    • all, indicates all items, so the formula is being applied to all items
    • current, refers the current item
    • parent, refers to the parent item
    • root, refers to the root item (the root item has no parent items)
    direction, must be one of the following:
    • dir, collects only direct descendents (child-items)
    • rec, collects recursivelly the leaf descendents ( leaf items ). A leaf item is an item with no child items
    • all, collects all descendents
    Currently, the following items are excluded by aggregate functions:
    not-sortable items. The SortableItem property specifies whether the item can be sorted ( a sortable item can change its position after sorting, while a not-sortable item keeps its position after sorting. not-selectable items. The SelectableItem property specifies whether the user can selects/focus the specified item. divider items. The ItemDivider property specifies whether the item displays a single cell, instead displaying whole cells.
    In conclusion, aggregate functions counts ONLY items that are sortable, selectable and not a divider-item.

    For instance:
    "get(`count(current,dir,1)`)", gets the count of child-items
    "get(`count(current,all,1)`)", gets the count of all child-items (implies recursively child items)
    "get(`count(current,rec,1)`)", counts the number of leaf items ( a leaf item is an item with no child items )
    "get(`sum(current,dir,%1 ? 1 : 0)`)", counts the number of child-items that have not-empty cells within the second-column
    "get(`sum(current,dir,value)`)", gets the total of values of child-items (direct descendent) within the same column
    "get(`sum(all,rec,value)`)", gets the total of values of leaf-items within the same column
    "get(`sum(parent,dir,dbl(%1) + dbl(%2))`)", gets the addition of all cells in the second (%1) and third (%2) column that are directly descendent of the parent item (sibling)
The format-expression supports the following binary-operators:
0 index `format`, gets the index of the item (0-based). The first added item has the index 0, the second added item has the index 1, and so on. The index of the item remains the same even if the order of the items is changed by sorting or grouping ( "1 index ``", gets the index of the item starting from 1 )
0 rindex `delimiter|format|format|...`, returns the recursive-index of the item ("1 rindex `.|A-Z`", returns values as A, A.1, A.2, B, ...)
0 pos `format`, returns the relative position of the item (the position within the parent's children collection) ( "1 pos ``", returns the position of the item (1-based) within the parent's child items collection )
0 rpos `delimiter|format|format|...`, returns the recursive relative-position of the item (the position within the parent's children collection) ( "1 rpos `.|A-Z`", returns values as A, A.1, A.2, B, ... )
0 opos `format`, returns the relative old position of the item (the position within the parent's children collection) ( "1 opos ``", returns the position of the item (1-based) within the parent's child items collection )
0 ropos `delimiter|format|format|...`, returns the recursive relative-old-position of the item (the position within the parent's children collection) ( "1 ropos `.|A-Z`", returns values as A, A.1, A.2, B, ... )
0 apos `format`, returns the absolute position of the item (the position from the first visible item) ( "1 apos ``", gets absolute position of the item )
0 rapos `delimiter|format|format|...`, returns the recursive absolute-position of the item (the position from the first visible item) ( "1 rapos `.|A-Z`", returns values as A, A.1, A.2, B, ... )
where:
  • `delimiter`, is a character to separated recursive-operators such as "rindex", "rpos", "ropos" and "rapos"
  • `format`, is a set of characters to be used for specifying the index
Type:
  • string
Example
"value format ``" {string}, shows the cell's value formatted as a number (as in regional settings)
 "1 index ``" {string}, gets the index (1-based) of the item
 "1 rpos `.|A-Z`" {string}, displays A, B, C for root-items, and A.1, A.2, A.1.1, ... B.1, B.2, ... for child-items
 "currency(dbl(%0) + dbl(%1))" {string}, adds columns 0 and 1 and displays the result as currency

(static) formatText :exontrol.DrawTextFormatEnum

The formatText field specifies the format to display the cell's caption, as a combination of one or more exontrol.DrawTextFormatEnum flags. The exontrol.DrawTextFormatEnum type supports the following flags:
  • exTextAlignTop (0x00), justifies the text to the top of the rectangle
  • exTextAlignLeft (0x00), aligns text to the left
  • exTextAlignCenter (0x01), centers text horizontally in the rectangle
  • exTextAlignRight (0x02), aligns text to the right
  • exTextAlignVCenter (0x04), centers text vertically
  • exTextAlignBottom (0x08), justifies the text to the bottom of the rectangle.
  • exTextAlignMask (0x0F), specifies the mask for text's alignment.
  • exTextWordBreak (0x10), breaks words. Lines are automatically broken between words if a word would extend past the edge of the rectangle specified by the lpRect parameter. A carriage return-line feed sequence also breaks the line. If this is not specified, output is on one line.
  • exTextSingleLine (0x20), displays text on a single line only. Carriage returns and line feeds do not break the line.
  • exTextExpandTabs (0x40), expands tab characters. The default number of characters per tab is eight.
  • exPlainText (0x80), treats the text as plain text.
  • exTextNoClip (0x0100), draws without clipping.
  • exHTMLTextNoColors (0x0200), ignores the and tags.
  • exTextCalcRect (0x0400), determines the width and height of the text.
  • exHTMLTextNoTags (0x0800), ignores all HTML tags.
  • exTextPathEllipsis (0x4000), for displayed text, replaces characters in the middle of the string with ellipses so that the result fits in the specified rectangle. If the string contains backslash (\) characters, exTextPathEllipsis preserves as much as possible of the text after the last backslash.
  • exTextEndEllipsis (0x8000), for displayed text, if the end of a string does not fit in the rectangle, it is truncated and ellipses are added. If a word that is not at the end of the string goes beyond the limits of the rectangle, it is truncated without ellipses.
  • exTextWordEllipsis (0x040000), truncates any word that does not fit in the rectangle and adds ellipses.
Type:
  • exontrol.DrawTextFormatEnum
Example
null {null}, centers the caption
  32 or exontrol.DrawTextFormatEnum.exTextSingleLine {number}, defines a single-line caption
  0x2A or exontrol.DrawTextFormatEnum.exTextSingleLine | exontrol.DrawTextFormatEnum.exTextAlignRight | exontrol.DrawTextFormatEnum.exTextAlignBottom {number}, defines a single-line caption right/bottom-aligned

(static) hasCheck :number

The hasCheck field specifies whether the cell's check-box, radio-button is visible or hidden Defines whether the cell's check-box, radio-button is visible as follows:
  • null {null}, the column's hasCheck field determines whether the cell's check-box, radio-button is visible or hidden
  • 0 {number}, the cell displays no check-box or radio-button
  • 1 {number}, the cell displays its check-box.
  • 2 {number}, the cell displays its radio-button (only a cell within the children of the parent-item can be checked).
Type:
  • number
Example
null {null}, the cell's check-box or radio-button is determined by the column's hasCheck field
 2 {number}, the cell displays its radio-button (cells of the same parent-item make the group of radio-cells, so only once can be checked at the time). By using the cell's individual hasCheck field on 2, you can specify multiple group of radio-buttons within the same column.

(static) image :string

The image field specifies the name of the image/picture the cell displays. The image can be added using the exontrol.HTMLPicture.Add() method
Type:
  • string

(static) imageAlign :number

The imageAlign field defines the alignment of the image within the cell. The imageAlign propery can be any of the following:
  • 0, the image is on the left of the cell's caption
  • 1, the image is on the right of the cell's caption
  • 2, the image is on the top of the cell's caption
  • 3, the image is on the bottom of the cell's caption
Type:
  • number
Example
null {null}, the image is aligned left to the caption (default)
 1 {number}, the image is displayed to the right of the cell's caption

(static) imageSize :null|number|Array.<number>

The imageSize field defines the size of the cell's image. The imageSize could be of one of the following types:
  • {null}, Indicates that the cell's image is displayed as it is (full-sized).
  • {number}, Specifies that the cell's image is displayed into a square of giving size (same width and height). If 0 the object displays no image, if negative the object's image is stretched to giving square, else the object's picture is scaled to fit the giving rectangle.
  • {number[]}, Specifies an array of [aspect-width,aspect-height] type that defines the limits for width or/and height. The aspect-width and aspect-height define the width/height of the object's picture to scale or stretch to.
Type:
  • null | number | Array.<number>
Example
null {null}, Indicates that the object's image is displayed as it is (full-sized).
 0 {number}, no image is displayed
 64 {number}, the image is scaled to fit a 64 x 64 rectangle
 -64 {number}, the image is strected to a 64 x 64 rectangle
 [32,64] {array}, scales the image to the largest ratio-rectangle (32 x 64) that fits the client
 [-32,-64] {array}, stretches the image to a 32 x 64 rectangle

(static) pad :number|Array.<number>|string

The pad field defines the cell's padding (space between the cell's content and its border), as one of the following:
  • {number} a numeric value, to pad horizontal and vertical size with the same value
  • {(string|number[])} a "x,y" or [x,y] type to specify the padding on horizontal and vertical side
Type:
  • number | Array.<number> | string
Example
null {null}, indicates that the default-padding field is used ([4,4])
  0 {number}, indicates no padding
  "8,4" {string}, increases the element's width with 2 * 8-pixels and element's height with 2 * 4-pixels
  [8,4] {array}, increases the element's width with 2 * 8-pixels and element's height with 2 * 4-pixels

(static) shape :any

The shape field defines the shape for individual cell. 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
null {null}, no custom shape is applied (default object's shape may be applied)
 "" {string}, no custom shape is applied (no default object's shape is be 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

(static) state :number

The state field specifies the cell's state (unchecked or checked) (can be requested within format-expression using the %CS syntax)
Type:
  • number
Example
0 {number}, the cell is unchecked
 1 {number}, the cell is checked
 2 {number}, the cell is partially-checked (valid for cells of check-box type)

(static) toolTip :string

The toolTip field defines the cell's predefined tooltip.
Type:
  • string
Example
null {null}, the cell's caption is shown once the mouse pointer hovers it, and it is not fully displayed
 "" {string}, no tooltip for the cell is displayed
 "<img>image</img> and text" {string}, the image and text is being shown once the mouse pointer hovers the cell. The image can be added using the exontrol.HTMLPicture.Add() method

(static) value :any

The value field defines the cell's value (can be requested within format-expression using the % syntax).
Type:
  • any
Example
null {null}, indicates no caption
 "caption" {string}, declares a plain-caption
 "<b>text</b>" {string}, displays the text in bold
 "<img>logo</img>" {string}, displays the "logo" image. The image can be added using the exontrol.HTMLPicture.Add() method