Constructor Summary
Public Constructor | ||
public |
constructor(defaultData: Array, opts: object) Constructor. |
Member Summary
Public Members | ||
public get |
length: * |
Private Members | ||
private |
_F_itemClass: * |
|
private |
_data: * |
Method Summary
Public Methods | ||
public |
[Symbol.iterator](): * |
|
public |
Add an item. |
|
public |
Add items. |
|
public |
Iterates each item of self, return an index of the first item predicate returns true. |
|
public |
forEach(cb: *) |
|
public |
Return an item at position. |
|
public |
Iterates each item of self, return the first item predicate returns true. |
|
public |
If you dynamically change wrapping item class according to the item, override this method. |
|
public |
Remove an item (specified by index). |
|
public |
Remove all items. |
|
public |
Remove last item. |
|
public |
replace all items |
|
public |
some(cb: *): * |
|
public |
Update an item at index. |
Private Methods | ||
private |
_wrapItem(item: *): * Wrap an item by Item class |
Inherited Summary
From class Core | ||
public |
Add handler or listener for saying message |
|
public |
Cast a message to the listeners |
|
public |
unescapeHtml(escaped: String): String Unescape HTML |
|
public |
unlistened(name: string, -: Function) Remove handler or listener |
|
private |
_callR(args: *, target: *, method: *, methodOwner: *) |
|
private |
_isFn(f: *): * |
|
private |
_isStr(v: *): * |
|
private |
_listened(name: *, handler: *) |
|
private |
_privates(): {"_F_obs": *} Return non-enumerable attribute definitions. |
|
private |
_say(targetName: *, name: *, ctx: *) |
From class Item | ||
public |
[field]: * |
|
public |
Add value to field-value. |
|
public |
destroy() Destroy me. |
|
public |
Toggle boolean field-value |
|
public |
Update the pairs of field-value. |
|
private |
_updateField(field: string, value: Any) Update field with value. |
Public Constructors
Public Members
public get length: * source
Private Members
private _F_itemClass: * source
private _data: * source
Public Methods
public add(item: Any, insertIndex: number) source
Add an item.
Override:
Item#addParams:
Name | Type | Attribute | Description |
item | Any | item |
|
insertIndex | number |
|
optional insert position, add last if not defined |
public find(predictOrField: string | Function, value: *): object source
Iterates each item of self, return an index of the first item predicate returns true.
public forEach(cb: *) source
Params:
Name | Type | Attribute | Description |
cb | * |
public get(index: number): * source
Return an item at position.
Params:
Name | Type | Attribute | Description |
index | number | item position. |
Return:
* | item specified by index. |
public indexOf(predictOrField: string | Function | Object, value: *): number source
Iterates each item of self, return the first item predicate returns true.
public itemClass(item: object): Class<View> source
If you dynamically change wrapping item class according to the item, override this method.
Params:
Name | Type | Attribute | Description |
item | object | an item |
public removeAll(opts: Object) source
Remove all items.
Params:
Name | Type | Attribute | Description |
opts | Object | if opts.reverse is true, removing from last to first. |
public reset(newValues: Array) source
replace all items
Params:
Name | Type | Attribute | Description |
newValues | Array |
|
new values or default empty array |
public update(item: Any, index: number) source
Update an item at index.
Override:
Item#updateParams:
Name | Type | Attribute | Description |
item | Any | item |
|
index | number | target index |
Private Methods
private _wrapItem(item: *): * source
Wrap an item by Item class
Params:
Name | Type | Attribute | Description |
item | * |
Return:
* |