new Item(oItems, oItems)
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")
Parameters:
| Name | Type | Description |
|---|---|---|
oItems |
Items | Indicates an object of Items type that's the owner collection of this item. |
oItems |
ItemOptions | Specifies the options to apply on the item. |
Members
AllowSizing :boolean
- 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)
The onchange("resize-item") event is raised only when the item height is changed by dragging. The "item-resize" action allows the user to change the height of an item by dragging it. The AllowSizing property is equivalent with GetAllowSizing()/SetAllowSizing(value) methods.
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
(readonly) ChildCount :number
Type:
- number
- Since:
- 5.1
Example
The following code snippet:
for ( var i = 0; i < oItem.ChildCount; i++ )
console.log( oItem.Child(i) );
enumerates all child-items of oItem
ChildCount
Cursor :string
Type:
- string
Example
"pointer" {string}, The cursor is a pointer that indicates a link (typically an image of a pointing hand)
Cursor
Divider :any
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
Enabled :boolean
Type:
- boolean
Example
false {boolean}, disables the item
true {boolean}, enables the item
Enabled
Expanded :boolean
Type:
- boolean
Example
false {boolean}, the item is collapsed
true {boolean}, the item is expanded (item's children are shown)
Expanded
(readonly) GroupItem :number
Type:
- number
Example
The following statements are equivalents:
oItem.GetGroupItem(), indicates a group item if positive or zero
oItem.GroupItem, indicates a group item if positive or zero
where oItem is an object of Item type
GroupItem
Height :array
Type:
- array
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
(readonly) Index :number
Type:
- number
Example
The following statements are equivalents:
oItem.GetIndex(), retrieves the item's index
oItem.Index, retrieves the item's index
where oItem is an object of Item type
Index
Key :string
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
Lock :Pivot.LockItemEnum
- exontrol.Pivot.LockItemEnum.exLockTop {Pivot.LockItemEnum} or -1 {number}, locks the item at the top
- exontrol.Pivot.LockItemEnum.exUnlock {Pivot.LockItemEnum} or 0 {number}, unlocks the item, making it scrollable
- exontrol.Pivot.LockItemEnum.exLockBottom {Pivot.LockItemEnum} or +1 {number}, locks the item at the bottom
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
(readonly) Locked :number
- -1 {number}, indicates that item is part of locked-items (top)
- 0/null/undefined {number}, indicates that item is part of scrollable items (unlocked)
- +1 {number}, indicates that item is part of locked-items (bottom)
The Lock property locks or unlocks the item, placing it at the top, bottom, or making it scrollable. The onclick event may not be fired if the Locked property is true
Type:
- number
- Since:
- 4.6
Example
The following statements are equivalents:
if (oItem.Locked) { ... } // checks whether the item is locked (either at top or bottom of the control)
where oItem is an object of Item type
Locked
Options :ItemOptions
Each 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")
It is important to note that changing a field of the ItemOptions object does not automatically update the control. For example, oItem.Options.cursor = "pointer" does not apply the change. Instead, you must assign the Options property again, such as oItem.Options = {cursor: "pointer"}, so the control updates and applies the new value.
Type:
Example
The following statements are equivalents:
oPivot.Item(0).Options = {shape: "red", height: 32}, changes the item's height and background
oPivot.Item(0).SetOptions({shape: "red", height: 32}), changes the item's height and background
where oPivot is an object of Pivot type
Options
Parent :null|Item
- {number}, indicates a numeric value that defines the index of the parent's item
- {string}, specifies a string expression that defines the identifier/key of the parent's item
- {Item}, specifies the object reference to the parent's item
The Parent property is equivalent with the GetParent() and SetParent() methods. The GetParent() method returns the item's parent as an object of Item type. The SetParent() method sets the item's parent. The Position property gets or sets the item's position (0-based). The onchange("drag-item") event occurs once the user moves the item by drag an drop. The user can move an item to a new position within the control by drag and drop when the "item-drag" action is enabled in the AllowActions property.
Type:
- null | 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
Position :number
Type:
- number
Example
The following statements are equivalents:
oItem.GetPosition(), retrieves the item's position
oItem.Position, retrieves the item's position
where oItem is an object of Item type
Position
Selectable :boolean
Type:
- boolean
Example
false {boolean}, the item is unselectable
true {boolean}, the item is selectable
Selectable
Selected :boolean
Type:
- boolean
Example
false {boolean}, the item is unselected
true {boolean}, the item is selected
Selected
Shape :any
- null, no custom-shape is applied on the object (default-shape may be applied instead)
- 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 Cell.Shape property changes the shape for the cell itself. The Column.CellShape property gets or sets the shape to apply on the column's body/data/cells. The Column.Shape property defines the shape to apply on the column's header. The Shapes property defines the shapes for each part of the control can display.
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.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
ShowExpand :boolean|number
- 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
Type:
- boolean | number
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
Sortable :boolean
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
Value :null|any|Array.<any>
Type:
- null | any | Array.<any>
- Since:
- 1.1
Example
null {null}, resets the caption for all cells of the item
"caption" {string}, defines the plain-caption for all cells of the item
["<img>al</img>Alexa","<img>dtop</img>Darius"] {string[]}, specifies the captions for the first two-cells (includes images too, The image can be added using the exontrol.HTMLPicture.Add method)
Value
Visible :boolean
Type:
- boolean
Example
false {boolean}, hides the item
true {boolean}, shows the item
Visible
Methods
Add(oOptionsopt) → {Item}
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
oOptions |
object |
<optional> |
Specifies the options to create the new item as an object of ItemOptions type. |
Returns:
- Type
- Item
Example
oPivot.Item(0).Add("caption"), adds a new child-item of the first item, and sets the caption for the first cell.
oPivot.Item(0).Add({value: "caption"}), adds a new child-item of the first item, and sets the caption for the first cell.
oPivot.Item(0).Add(["Cell 1","Cell 2"]), adds a new child-item of the first item, and sets the caption for the first and second cell.
oPivot.Item(0).Add({value: ["Cell 1","Cell 2"]}), adds a new child-item of the first item, and sets the caption for the first and second cell.
Add
Cell(column) → {Cell}
Parameters:
| Name | Type | Description |
|---|---|---|
column |
any | The id parameter could be any of the following:
|
Returns:
- Type
- Cell
Child(index) → {Item}
Parameters:
| Name | Type | Description |
|---|---|---|
index |
number | Specifies the zero-based index of the child item to retrieve (supports negative indexes as well, where -1 indicates the last added child item, -2 the second last, and so on). |
- Since:
- 5.1
Returns:
- Type
- Item
Example
The following code snippet:
for ( var i = 0; i < oItem.GetChildCount(); i++ )
console.log( oItem.Child(i) );
enumerates all child-items of oItem
Child
Remove()
ToggleExpand()
Example
oPivot.Item(0).ToggleExpand(), toggles the expand state of the first item. If the first item is expanded, it will be collapsed, and if it is collapsed, it will be expanded.
ToggleExpand