nx.data.Counter - Next UI Toolkit

#

API Docs for: trial
Show: Inherited Protected Private Deprecated

# nx.data.Counter Class

Uses

- nx.Observable

Module: nx.data

- Index
- Methods
- Events

## Item Index

### Methods

- clearBinding
- decrease
- dispose
- getBinding
- getCount
- increase
- notify
- setBinding
- setCount
- unwatch

### Events

- change
- decrease
- increase

## Methods

### ``

(

- `names`
- `handler`
- `context`

)

Inherited from nx.Observable:

#### Parameters:

- `names` Object
- `handler` Object
- `context` Object

### `clearBinding`

(

- `prop`

)

Inherited from nx.Observable:

Clear binding for specified property.

#### Parameters:

- `prop` Object

### `decrease`

(

- `item`
- `decrement`

)

Decrease the count of given item.

#### Parameters:

- `item` Any

  The item to count.

- `decrement` Number

  The decrement, default 1.

#### Returns:

The decreasing result

### `dispose`

()

Inherited from nx.Observable:

Dispose current object.

### `getBinding`

(

- `prop`

)

Inherited from nx.Observable:

Get existing binding object for specified property.

#### Parameters:

- `prop` Object

#### Returns:

:

### `getCount`

(

- `item`

)

Get count of specified item.

#### Parameters:

- `item` Any

  The counting item.

#### Returns:

Count of the item.

### `increase`

(

- `item`
- `increment`

)

Increase the count of given item.

#### Parameters:

- `item` Any

  The item to count.

- `increment` Number

  The increment, default 1.

#### Returns:

The increasing result

### `notify`

(

- `names`
- `oldValue`

)

Inherited from nx.Observable:

#### Parameters:

- `names` Object
- `oldValue` Object

### `setBinding`

(

- `prop`
- `expr`
- `source`

)

Inherited from nx.Observable:

Set binding for specified property.

#### Parameters:

- `prop` Object
- `expr` Object
- `source` Object

### `setCount`

(

- `item`
- `count`

)

Set count of specified item.

#### Parameters:

- `item` Any

  The counting item.

- `count` Number

  The count to be set.

#### Returns:

Set result count.

### `unwatch`

(

- `names`
- `handler`
- `context`

)

Inherited from nx.Observable:

#### Parameters:

- `names` Object
- `handler` Object
- `context` Object

## Events

### `change`

An event which notifies the happening of a count change of item.

#### Event Payload:

- `evt` Object

  The event object with item, count, previousCount.

### `decrease`

Same as change event but only happens on count decreasing.

#### Event Payload:

- `evt` Object

  The event object with item, count, previousCount.

### `increase`

Same as change event but only happens on count increasing.

#### Event Payload:

- `evt` Object

  The event object with item, count, previousCount.