nx.data.ObservableCollection Class
Item Index
Methods
Methods
calculate
(
-
experssion
-
sources
Calculate and synchronize collection with a collection calculation.
Returns:
resource for release the binding
clear
()
dispose
()
Dispose current object.
getBinding
(
-
prop
Get existing binding object for specified property.
Parameters:
-
prop
Object
Returns:
:
indexOf
(
-
item
Get the first index the given item appears in the collection, -1 if not found.
Parameters:
-
item
Object
Returns:
:
monitor
(
-
handler
Apply a diff watcher, which handles each item in the collection, to the collection.
Parameters:
-
handler
Objectlambda(item) returning a rollback method
Returns:
unwatcher A Object with unwatch method.
select
(
-
source
-
conditions
-
determinator
Select a sub-collection from a source collection. Usage:
// select all items from collection with property active==true resource = subCollection.select(collection, "active") // select all items from collection with path owner.name=="Knly" resource = subCollection.select(collection, "owner.name", function(name){ return name==="Knly"; }); // select all string item from collection resource = subCollection.select(collection, function(item){ return typeof item === "string"; });
Parameters:
-
source
nx.data.ObservableCollection -
conditions
String -
determinator
Function
Returns:
resource for release the binding
setBinding
(
-
prop
-
expr
-
source
Set binding for specified property.