Items class (Rollist)

Items(oRollist)

new Items(oRollist)

The Items object holds a collection of Item type (item of the control). Use the Items/GetItems() method to access the control's items collection.
Parameters:
Name Type Description
oRollist Rollist Indicates an object of Rollist type that owns the collection
Items

Methods

Add(oItemOptsopt) → {Item}

The Add() method creates and adds a new item into the control. Use the Add() method of the Item object to a new child-item into the control.
Parameters:
Name Type Attributes Description
oItemOpts object <optional>
Specifies the options to create the new item as an object of ItemOptions type
Returns:
Returns the newly created item, as an object of Item type
Type
Item
Example
oRollist.Item.Add("caption"), adds a new item with the specified caption.
 oRollist.Item.Add({value: "caption"}), adds a new item with the specified caption.
Add

Clear()

The Clear() method removes all items of the control and inits the control's scroll-bars
Clear

GetCount() → {number}

The GetCount() method returns the number of items within the collection
Returns:
Returns the number of items within the collection
Type
number
Example
The following statements are equivalents:

 oRollist.Item.GetCount(), counts the items within the control
 oRollist.Item.Count, counts the items within the control

where oRollist is an object of Rollist type
GetCount

Item(id) → {null|Item}

The Item() method gets the item giving its index, identifier/key or reference. The Item(id) method returns the item based on its index or identifier/key (equivalent of this method)
Parameters:
Name Type Description
id any The id parameter could be any of the following:
  • id {number}, indicates a numeric value that defines the index of the item to request
  • id {string}, specifies a string expression that defines the identifier/key of the item to request
  • id {Item}, specifies the object reference to the item to request for
Returns:
Returns null if the item is not found, or an object of Item type, if the items collection contains the giving id.
Type
null | Item
Item

Remove(id)

The Remove() method removes an item from the collection.
Parameters:
Name Type Description
id any The id parameter could be any of the following:
  • id {number}, indicates a numeric value that defines the index of the item to request
  • id {string}, specifies a string expression that defines the identifier/key of the item to request
  • id {Item}, specifies the object reference to the item to request for
Remove

RemoveRange(range)

The RemoveRange() method removes multiple-items at once
Parameters:
Name Type Description
range any Indicates an item, an array [{Item}], or an exontrol.Arr([{Item}])
RemoveRange