API Docs for: trial
Show:

nx.data.ObservableCollection Class

Methods

add

(
  • item
)

Inherited from nx.data.Collection

Add an item.

Parameters:

addRange

(
  • iter
)

Inherited from nx.data.Collection

Parameters:

calculate

(
  • experssion
  • sources
)

Calculate and synchronize collection with a collection calculation.

Parameters:

Returns:

resource for release the binding

clear

()

Inherited from nx.data.Collection

clearBinding

(
  • prop
)

Inherited from nx.Observable:

Clear binding for specified property.

Parameters:

contains

(
  • item
)
Boolean

Inherited from nx.data.Collection:

Parameters:

Returns:

dispose

()

Inherited from nx.Observable:

Dispose current object.

each

(
  • callback
  • context
)

Inherited from nx.Iterable

Parameters:

getBinding

(
  • prop
)

Inherited from nx.Observable:

Get existing binding object for specified property.

Parameters:

Returns:

:

getItem

(
  • index
)

Inherited from nx.data.Collection:

Parameters:

Returns:

:

getRange

(
  • index
  • count
)
Collection

Inherited from nx.data.Collection:

Parameters:

Returns:

Collection:

indexOf

(
  • item
)

Inherited from nx.data.Collection:

Get the first index the given item appears in the collection, -1 if not found.

Parameters:

Returns:

:

insert

(
  • item
  • index
)

Inherited from nx.data.Collection

Parameters:

insertRange

(
  • iter
  • index
)

Inherited from nx.data.Collection

Parameters:

lastIndexOf

(
  • item
)

Inherited from nx.data.Collection:

Parameters:

Returns:

:

monitor

(
  • handler
)

Apply a diff watcher, which handles each item in the collection, to the collection.

Parameters:

  • handler Object

    lambda(item) returning a rollback method

Returns:

unwatcher A Object with unwatch method.

notify

(
  • names
  • oldValue
)

Inherited from nx.Observable:

Parameters:

remove

(
  • item
)

Inherited from nx.data.Collection

Parameters:

removeAt

(
  • index
)

Inherited from nx.data.Collection

Parameters:

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:

Returns:

resource for release the binding

setBinding

(
  • prop
  • expr
  • source
)

Inherited from nx.Observable:

Set binding for specified property.

Parameters:

sort

(
  • comp
)

Inherited from nx.data.Collection

Parameters:

(
  • names
  • handler
  • context
)

Inherited from nx.Observable:

Parameters:

toArray

() Array

Inherited from nx.Iterable

Returns:

toggle

(
  • item
)

Inherited from nx.data.Collection:

Toggle item's existence.

Parameters:

unwatch

(
  • names
  • handler
  • context
)

Inherited from nx.Observable:

Parameters:

Properties

count

Number

Inherited from nx.Iterable

length

Number

Inherited from nx.data.Collection: