ItemOptions class (Pivot)

ItemOptions()

new ItemOptions()

The ItemOptions type holds all options an Item can display or own

Every option of the ItemOptions type has associated a property of the Item object. For instance, the option:

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

Members

(static) allowSizing :object

The allowSizing field specifies whether the item is resizable or fixed. The allowSizing field has effect only if the "item-resize" action is allowed. If the allowSizing field is true, the user can resize the item by drag. The height field specifies the item's height. If the allowSizing field is false, the item is fixed, so user cannot resize the item by drag. If the allowSizing field is null, the control's itemAllowSizing field specifies whether the item is resizable or fixed.

The allowSizing field is mapped to the Item.AllowSizing property, which means that the following statements are equivalent:

oItem.Options = {allowSizing: true}
oItem.SetOptions({allowSizing: true})
oItem.AllowSizing = true
oItem.SetAllowSizing(true)
Type:
  • object
Example
null {null}, the control's itemAllowSizing field specifies whether the item is resizable or fixed
false {boolean}, the item is fixed
true {boolean}, the item is resizable, so user can resize the item by drag (if "item-resize" action is allowed)
allowSizing

(static) cursor :object

The cursor field defines the mouse-cursor for individual item. If the cursor field is null, the control's cursors field defines the cursor for different parts of the control. If the cursor field is not null, it defines the cursor for the item. The cursor field can be any CSS cursor value, such as "pointer", "crosshair" and so on.

The cursor field is mapped to the Item.Cursor property, which means that the following statements are equivalent:

oItem.Options = {cursor: "pointer"}
oItem.SetOptions({cursor: "pointer"})
oItem.Cursor = "pointer"
oItem.SetCursor("pointer")
Type:
  • object
Example
"pointer" {string}, The cursor is a pointer that indicates a link (typically an image of a pointing hand)
cursor

(static) divider :object

The divider field shows the item as a divider (an divider-item shows a cell only). A divider item is an item that shows a single cell that can be used as a divider between items. If the divider field is null, the item is not a divider-item, so it displays whole cells. If the divider field is not null, the item is a divider-item, so it shows a single cell. The value of the divider field defines which cell to show for the divider-item. If the value of the divider field is 0 or "0", the item shows the first cell (the cell with index 0). If the value of the divider field is "xxx", the item shows the cell on the column "xxx" (key or plain-caption). The "itemDiv" field of Shapes property defines the visual-appearance for divider-items.

The divider field is mapped to the Item.Divider property, which means that the following statements are equivalent:

oItem.Options = {divider: 0}
oItem.SetOptions({divider: 0})
oItem.Divider = 0
oItem.SetDivider(0)
Type:
  • object
Example
null {null}, multiple-columns item (no divider-item)
0 {number}, divider-item that always displays the cell with the index 0
"xxx" {string}, divider-item that always displays the cell on the column "xxx" (key or plain-caption)
divider

(static) enabled :object

The enabled field indicates whether the item is enabled or disabled. A disabled item is displayed in a grayed-out state and does not respond to user interactions, but it still exists in the control's items collection and can be requested by its index or key. A disabled item can be visible or hidden, depending on the value of its visible field.

The enabled field is mapped to the Item.Enabled property, which means that the following statements are equivalent:

oItem.Options = {enabled: false}
oItem.SetOptions({enabled: false})
oItem.Enabled = false
oItem.SetEnabled(false)
Type:
  • object
Example
false {boolean}, disables the item
true {boolean}, enables the item
enabled

(static) expanded :object

The expanded field indicates whether the item is expanded or collapsed. If the expanded field is false, the item is collapsed, so its children items are hidden. If the expanded field is true, the item is expanded, so its children items are shown. The showExpand field specifies whether the item shows its expand/collapse glyphs. If the showExpand field is false, the item hides its expand/collapse glyphs (no indentation is applied). If the showExpand field is true, the item shows its expand/collapse glyphs (indentation is applied). If the showExpand field is -1, the item shows no expand/collapse glyphs, instead indentation is applied. By default, the expanded field is true.

The expanded field is mapped to the Item.Expanded property, which means that the following statements are equivalent:

oItem.Options = {expanded: true}
oItem.SetOptions({expanded: true})
oItem.Expanded = true
oItem.SetExpanded(true)
Type:
  • object
Example
false {boolean}, the item is collapsed
true {boolean}, the item is expanded (item's children are shown)
expanded

(static) height :object

The height field defines the item's height. If the height field is not specified, the control's defaultItemHeight field determines the item's height. If the allowSizing field is true or the control's itemAllowSizing field is true, the user can resize the item by dragging it, so the height field defines only the initial height of the item. The visible field specifies whether the item is displayed or hidden. A hidden item is not shown in the control, but it still exists in the control's items collection and can be accessed by its index or key. If a parent item is hidden, all its child items are also hidden, even if their visible field is true. In this case, the visible field of a child item determines whether it will be shown or hidden when its parent item becomes visible. You can use the filtering feature to show or hide items based on specific criteria.

The height field is mapped to the Item.Height property, which means that the following statements are equivalent:

oItem.Options = {height: 18}
oItem.SetOptions({height: 18})
oItem.Height = 18
oItem.SetHeight(18)
Type:
  • object
Example
null {null}, indicates that the item's height is defined by the control's defaultItemHeight field (22)
18 {number}, specifies the item's height to 18
height

(static) key :object

The key field specifies the key associated with the item. Specifies the key associated with the item. If no key is provided, the item's plain-caption can be used to request an item. The plain-caption includes no ex-HTML tags, such as <b>, <fgcolor> and so on. The Pivot.Item("key") method allows you to request the item giving its key.

The key field is mapped to the Item.Key property, which means that the following statements are equivalent:

oItem.Options = {key: "logo"}
oItem.SetOptions({key: "logo"})
oItem.Key = "logo"
oItem.SetKey("logo")
Type:
  • object
Example
"logo" {string}, defines the item with the giving key (logo). You can use the Root.Item("logo") method to request the item giving its key.
key

(static) lock :object

The lock field specifies whether the item is locked at the top, locked at the bottom, or scrollable. If the lock field is "top" or -1, the item is locked at the top, so it always appears at the top of the control and does not scroll with other items. If the lock field is "bottom" or 1, the item is locked at the bottom, so it always appears at the bottom of the control and does not scroll with other items. If the lock field is "unlock" or 0, the item is scrollable, so it scrolls with other items. By default, all items are unlocked (scrollable). A locked item is not sortable, so it keeps its position after user performs a sort operation. The sortable field indicates whether the item is sortable or unsortable.

The lock field is mapped to the Item.Lock property, which means that the following statements are equivalent:

oItem.Options = {lock: "top"}
oItem.SetOptions({lock: "top"})
oItem.Lock = "top"
oItem.SetLock("top")
Type:
  • object
Since:
  • 4.6
Example
"top" {string} or -1 {number}, locks the item at the top
"unlock" {string} or 0 {number}, unlocks the item, making it scrollable
lock

(static) parent :object

The parent field defines the item's parent. The parent field can be a number, string or an object reference to an item. If the parent field is null, the item is a root item, so it has no parent. If the parent field is not null, it defines the item's parent. The parent field can be used while adding an item to specify the parent of the new item. For instance, the statement Add({parent: 0}) adds a new item as child of the first item (the item with index 0). The statement Add({parent: "key"}) adds a new item as child of the item with the key "key". The statement Add({parent: oItem}) adds a new item as child of oItem.

The parent field can be one of the following:

  • parent {number}, indicates a numeric value that defines the index of the parent's item (0-based)
  • parent {string}, specifies a string expression that defines the identifier/key of the parent's item
  • parent {Item}, specifies the object reference to the parent's item

The parent field is mapped to the Item.Parent property, which means that the following statements are equivalent:

oItem.Options = {parent: 0}
oItem.SetOptions({parent: 0})
oItem.Parent = 0
oItem.SetParent(0)
Type:
  • object
Example
0 {number}, indicates that the item with the index 0 is the parent of the current item
"key" {string}, specifies that the parent of the current item is the item with the giving key
parent

(static) position :object

The position field specifies the item's position. The sortable field indicates whether the item is sortable or unsortable. If the sortable field is false, the item is unsortable, so it keeps its position after user performs a sort operation. If the sortable field is true, the item is sortable, so it can change its position after user performs a sort operation. The position field specifies the item's position.

The position field is mapped to the Item.Position property, which means that the following statements are equivalent:

oItem.Options = {position: 0}
oItem.SetOptions({position: 0})
oItem.Position = 0
oItem.SetPosition(0)
Type:
  • object
Since:
  • 1.7
Example
null {null}, the null value has no effect
0 {number}, moves the item on the first position
position

(static) selectable :object

The selectable field indicates whether the item is selectable or unselectable. The selected field indicates whether the item is selected or unselected. If the selectable field is false, the item is unselectable, so it cannot be selected/focused by user. If the selectable field is true, the item is selectable, so it can be selected/focused by user.

The selectable field is mapped to the Item.Selectable property, which means that the following statements are equivalent:

oItem.Options = {selectable: true}
oItem.SetOptions({selectable: true})
oItem.Selectable = true
oItem.SetSelectable(true)
Type:
  • object
Example
false {boolean}, the item is unselectable
true {boolean}, the item is selectable
selectable

(static) selected :object

The selected field indicates whether the item is selected or unselected. If the selected field is false, the item is unselected, so it is not focused and has no selection mark. If the selected field is true, the item is selected, so it is focused and has a selection mark. The selectable field indicates whether the item is selectable or unselectable. If the selectable field is false, the item is unselectable, so it cannot be selected/focused by user. If the selectable field is true, the item is selectable, so it can be selected/focused by user. By default, the selected field is false, so the item is unselected.

The selected field is mapped to the Item.Selected property, which means that the following statements are equivalent:

oItem.Options = {selected: true}
oItem.SetOptions({selected: true})
oItem.Selected = true
oItem.SetSelected(true)
Type:
  • object
Example
false {boolean}, the item is unselected
true {boolean}, the item is selected
selected

(static) shape :object

The shape field defines the shape for individual item. The "item" field of Shapes property defines the visual-appearance for all items within the control. The Item.Shape property defines the shape for the item itself.. The "itemAlt" field of Shapes property defines the visual-appearance for alternate-items (every second item). The Item.Shape property defines the shape for the item itself.. The "itemDiv" field of Shapes property defines the visual-appearance for divider-items (a divider-item displays only a single-cell). The Item.Shape property defines the shape for the item itself.. The shape field defines the visual-appearance for the item, so it has higher priority than the "item", "itemAlt" and "itemDiv" fields of Shapes property. In other words, if the shape field is not null, the shape defined by this field is applied on the item, else the shape defined by "item", "itemAlt" or "itemDiv" field of Shapes property is applied on the item, depending on whether the item is an alternate-item or a divider-item.

The shape field can be any of the following:

  • the shape's name within the exontrol.Shapes.Pivot or exontrol.Shapes namespace
  • a CSS color
  • a JSON string-representation of an object of exontrol.Def.Shape type
  • an object of {normal,hover,click,disabled} type. The normal, hover, click and disabled are objects of exontrol.Def.Shape type

The shape field is mapped to the Item.Shape property, which means that the following statements are equivalent:

oItem.Options = {shape: "red"}
oItem.SetOptions({shape: "red"})
oItem.Shape = "red"
oItem.SetShape("red")
Type:
  • object
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.Pivot.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)
"Button" or exontrol.Shapes.Button {object}, applies the "Button" shape on the object as defined into exontrol.Shapes namespace (@since 5.2)
shape

(static) showExpand :object

The showExpand field specifies whether the item displays its expand/collapse glyphs. If the showExpand field is false, the item hides its expand/collapse glyphs (no indentation is applied). If the showExpand field is true, the item shows its expand/collapse glyphs (indentation is applied). If the showExpand field is -1, the item shows no expand/collapse glyphs, instead indentation is applied. By default, the showExpand field is true for items with children and false for leaf items (items with no children).

The showExpand field is mapped to the Item.ShowExpand property, which means that the following statements are equivalent:

oItem.Options = {showExpand: true}
oItem.SetOptions({showExpand: true})
oItem.ShowExpand = true
oItem.SetShowExpand(true)
Type:
  • object
Example
false {boolean}, the item hides its expand/collapse glyphs (no indentation is applied)
true {boolean}, the item shows its expand/collapse glyphs (indentation is applied)
-1 {number}, the item shows no expand/collapse glyphs, instead indentation is applied
showExpand

(static) sortable :object

The sortable field indicates whether the item is sortable or unsortable. If the sortable field is false, the item is unsortable, so it keeps its position after user performs a sort operation. If the sortable field is true, the item is sortable, so it can change its position after user performs a sort operation. The position field specifies the item's position. By default, all items are sortable.

The sortable field is mapped to the Item.Sortable property, which means that the following statements are equivalent:

oItem.Options = {sortable: false}
oItem.SetOptions({sortable: false})
oItem.Sortable = false
oItem.SetSortable(false)
Type:
  • object
Example
false {boolean}, the item is unsortable (an unsortable item keeps its position after user performs a sort operation)
true {boolean}, the item is sortable
sortable

(static) value :object

The value field defines the value(s) of first cell(s) once the item is added. Defines the value of the first cell(s). The value field has effect only while using with the Add({value}) method of exontrol.Pivot.Items or Item type. If the value is an array, it specifies the values for cells within the item to be added, else it specifies the value for the first-cell (the cell with the index 0). The Cell.Value property specifies the value of the cell. The value field can be a string, number, boolean, date or an array of these types.

The value field is mapped to the Item.Value property, which means that the following statements are equivalent:

oItem.Options = {value: [1, 2]}
oItem.SetOptions({value: [1, 2]})
oItem.Value = [1, 2]
oItem.SetValue([1, 2])
Type:
  • object
Example
Add("caption") {Item}, adds a new item, and sets the caption for the first cell.
Add({value: "caption"}) {Item}, adds a new item, and sets the caption for the first cell.
Add(["Cell 1","Cell 2"]) {Item}, adds a new item, and sets the caption for the first and second cell.
Add({value: ["Cell 1","Cell 2"]}) {Item}, adds a new item, and sets the caption for the first and second cell.
value

(static) visible :object

The visible field indicates whether the item is visible or hidden. A hidden item is not displayed within the control, but it still exists in the control's items collection and can be requested by its index or key. All children items are hidden if their parent item is hidden, even if their visible field is true. In this case, the visible field of children items indicates whether the item is visible or hidden when its parent item is shown (not hidden). You can use the filtering feature to filter for items, which means that you can show or hide items based on a specific criteria. The height field defines the item's height. If height field is not specified, the control's defaultItemHeight field defines the item's height.

The visible field is mapped to the Item.Visible property, which means that the following statements are equivalent:

oItem.Options = {visible: false}
oItem.SetOptions({visible: false})
oItem.Visible = false
oItem.SetVisible(false)
Type:
  • object
Example
false {boolean}, hides the item
true {boolean}, shows the item
visible