new ItemOptions()
Every option of the ItemOptions type has associated a property of the Item object. For instance, the option:
value {string}, defines the value for individual itemis associated with the property:
Value {any}, defines the value for individual itemwhich means that the following statements are equivalent:
oItem.Options = {value: 100}where oItem is an object of Item type
oItem.SetOptions({value: 100})
oItem.Value = 100
oItem.SetValue(100)
It is important to note that changing a field of the ItemOptions object does not automatically update the item. For example, oItem.Options.value = 100 does not apply the change. Instead, you must assign the Options property again, such as oItem.Options = {value: 100}, so the item updates and applies the new value.
Example
{value: "<b>caption</b>"} {object}, defines an item that shows the "caption" text in bold
{value: "caption", className: "red"} {object}, defines an item that shows the "caption" text and applies the .red style to it
Members
(static) className :string
The className field is mapped to the ClassName property of the Item object, which means that the following statements are equivalent:
oItem.Options = {className: "red"}
oItem.SetOptions({className: "red"})
oItem.ClassName = "red"
oItem.SetClassName("red")
Type:
- string
Example
null {null} or "" {string}, no extra class name applied
"red" {string}, appends 'red' to the HTML element's class name, applying the .red style to the item
className
(static) key :string
The key field is mapped to the Key property of the Item object, 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 Items.Item("logo") method to request the item giving its key.
key
(static) position :number
The position field is mapped to the Position property of the Item object, which means that the following statements are equivalent:
oItem.Options = {position: 0}
oItem.SetOptions({position: 0})
oItem.Position = 0
oItem.SetPosition(0)
Type:
- number
Example
null {null}, the null value has no effect
0 {number}, moves the item on the first position
position
(static) value :string
The value field is mapped to the Value property of the Item object, which means that the following statements are equivalent:
oItem.Options = {value: "caption"}
oItem.SetOptions({value: "caption"})
oItem.Value = "caption"
oItem.SetValue("caption")
Type:
- string
Example
"caption" {string}, defines an item that shows the "caption" text
"<b>caption</b>" {string}, defines an item that shows the "caption" text in bold
"<font color='red'>caption</font>" {string}, defines an item that shows the "caption" text in red color
"<li>caption</li>" {string}, defines an item that shows the "caption" text as a list item
value
(static) visible :boolean
The visible field is mapped to the Visible property of the Item object, 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