Class
zebkit.data.ListModel
mixed with <zebkit.data.DataModel> <zebkit.EventProducer> |
<zebkit.data> |
List model class
zebkit.data.ListModel
([a]
)
Parameters:
-
[a]
<Array>an array the list model has to be initialized with
Example:
// create list model that contains three integer elements
var l = new zebkit.data.ListModel([1,2,3]);
l.on("elementInserted", function(list, element, index) {
// handle list item inserted event
...
})
...
l.add(10)
public | void | add (o) |
public | <Boolean> | contains (o) |
public | <Integer> | count ( ) |
public | <Object> | get (i) |
public | <Integer> | indexOf (o) |
public | void | insert (i, o) |
public | void | remove (o) |
public | void | removeAll ( ) |
public | void | removeAt (i) |
public | <Object> | setAt (i, o) |
public
void
add (o )
Add the given item to the end of the list Parameters:
|
public
<Integer>
count ( )
Get number of elements stored in the list
Returns:
<Integer>
a number of element in the list |
public
<Integer>
indexOf (o )
Get position the given element is stored in the list Parameters:
Returns:
<Integer>
the element position. -1 if the element cannot be found in the list |
public
void
insert (i, o )
Insert the given element into the given position of the list Parameters:
|
public
void
remove (o )
Remove the given element from the list Parameters:
|
public
void
removeAll ( )
Remove all elements from the list model |
public
void
removeAt (i )
Remove an element at the given location of the list model Parameters:
|
elementInserted
Fired when a new element has been added to the list model
Parameters:
|
elementRemoved
Fired when an element has been removed from the list model
Parameters:
|
elementSet
Fired when an element has been re-set
Parameters:
|