Configuration

This section describes configuration options used to configure the ArrayStore.

data

Specifies the array associated with this Store.

Type:

Array<any>

errorHandler

Specifies the function called when the Store causes an error.

Type:

function

The function passed to this option takes on the JavaScript Error object as a parameter.

JavaScript
var storeConfig = {
    errorHandler: function(error) {
        console.log(error.message);
    }
};

key

Specifies the key properties within the data associated with the Store.

Type:

String

|

Array<String>

The key configuration option is required if you create a Store for read-write data access. The key property is specified by an appropriate getter. If you need to specify a compound key property, assign an array of getters to this option.

The following example demonstrates how to set id and code key properties.

JavaScript
var storeConfig = {
    key: ["id", "code"]
}

onInserted

A handler for the inserted event.

Type:

function

Function parameters:
values:

Object

An object representing the inserted item.

key:

Object

|

String

|

Number

A key value of the inserted item.

Assign a function to perform a custom action after a data item is added.

onInserting

A handler for the inserting event.

Type:

function

Function parameters:
values:

Object

An object representing the item being inserted.

Assign a function to perform a custom action before a data item is added.

onLoaded

A handler for the loaded event.

Type:

function

Function parameters:
result:

Array<any>

The loaded data array.

Assign a function to perform a custom action after data is loaded.

onLoading

A handler for the loading event.

Type:

function

Function parameters:
loadOptions:

LoadOptions

An object defining options for the loaded data.

Assign a function to perform a custom action before data is loaded.

onModified

A handler for the modified event.

Type:

function

Assign a function to perform a custom action after data is modified.

onModifying

A handler for the modifying event.

Type:

function

Assign a function to perform a custom action before the data is modified.

onRemoved

A handler for the removed event.

Type:

function

Function parameters:
key:

Object

|

String

|

Number

A key value of the removed item.

Assign a function to perform a custom action after a data item has been removed.

onRemoving

A handler for the removing event.

Type:

function

Function parameters:
key:

Object

|

String

|

Number

A key value of the item being removed.

Assign a function to perform a custom action before a data item is removed.

onUpdated

A handler for the updated event.

Type:

function

Function parameters:
key:

Object

|

String

|

Number

A key value of the updated item.

values:

Object

New values for the updated item.

Assign a function to perform a custom action after a data item has been updated.

onUpdating

A handler for the updating event.

Type:

function

Function parameters:
key:

Object

|

String

|

Number

A key value of the item being updated.

values:

Object

New values for the item being updated.

Assign a function to perform a custom action before a data item is updated.