Source code
CERNY.event.List
This script offers an array augmentor which provides methodes to add and remove items which will notify observers of the respective event.
Used by
None
Functions
List
Augments an array to signal events regarding its items.
array (Array)
:
the array to augment to a List
addItem
Add an item to the end of the list. Notify observers of EVT_ITEM_ADDED.
item (any)
:
the item to add
insertItemAt
Insert an item at a specific position in the list. Notify observers of EVT_ITEM_INSERTED with the index of the inserted item.
index (any)
:
the index of the position at which to insert the item
item
:
the item to insert
removeItem
Remove an item from the list. Notify observers of EVT_ITEM_REMOVED with the index of the remove item.
item (any)
:
the item to remove
sortItems
Sort the items of the list according to a comparator. Notify observers of EVT_REARRANGED.
comperator (function)
:
the comparator to use for sorting
History
2007-08-19
:
Added sortItems and EVT_REARRANGED.
2007-08-10
:
Created.
