ItemOptions()
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 itemis associated with the property:
Cursor {string}, defines the mouse-cursor for individual itemwhich means that the following statements are equivalent:
oItem.Options = {cursor: "pointer"}where oItem is an object of Item type
oItem.SetOptions({cursor: "pointer"})
oItem.Cursor = "pointer"
oItem.SetCursor("pointer")
Example
The following example shows how to get the options of the first item of the tree:
var oItemOptions = oGantt.Item(0).Options;
The following example shows how to set the options of the first item of the tree:
oGantt.Item(0).Options = {enabled: false, visible: false};
where oGantt is an object of Gantt type
Members
(static) allowSizing :boolean
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:
- boolean
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 :string
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:
- string
Example
"pointer" {string}, The cursor is a pointer that indicates a link (typically an image of a pointing hand)
cursor
(static) divider :any
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:
- any
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 :boolean
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:
- boolean
Example
false {boolean}, disables the item
true {boolean}, enables the item
enabled
(static) expanded :boolean
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:
- boolean
Example
false {boolean}, the item is collapsed
true {boolean}, the item is expanded (item's children are shown)
expanded
(static) height :number
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:
- number
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 :string
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:
- string
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 :Gantt.LockItemEnum
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:
- 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 :number|string|Item
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:
- number | string | Item
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 :number
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:
- number
- Since:
- 1.7
Example
null {null}, the null value has no effect
0 {number}, moves the item on the first position
position
(static) selectable :boolean
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:
- boolean
Example
false {boolean}, the item is unselectable
true {boolean}, the item is selectable
selectable
(static) selected :boolean
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:
- boolean
Example
false {boolean}, the item is unselected
true {boolean}, the item is selected
selected
(static) shape :any
The shape field can be any of the following:
- the shape's name within the exontrol.Shapes.Gantt 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:
- 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.Gantt.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 :boolean
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:
- boolean
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 :boolean
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:
- boolean
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 :any
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:
- any
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 :boolean
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:
- boolean
Example
false {boolean}, hides the item
true {boolean}, shows the item
visible