For up to date documentation and features, visit http://docs.sencha.com/ext-js/4-0

## Sencha Documentation

# Ext.data.Operation

Represents a single read or write operation performed by a Proxy. Operation objects are used to enable communication between Stores and Proxies. Application developers should rarely need to interact with Operation objects directly.

Several Operations can be batched together in a batch.

Defined By

### Config Options

#### Other Configs

Ext.data.Operation
view source
action : String

The action being performed by this Operation. Should be one of 'create', 'read', 'update' or 'destroy'

The action being performed by this Operation. Should be one of 'create', 'read', 'update' or 'destroy'

Ext.data.Operation
view source
batch : Ext.data.Batch

The batch that this Operation is a part of (optional)

The batch that this Operation is a part of (optional)

Ext.data.Operation
view source
filters : Array

Optional array of filter objects. Only applies to 'read' actions.

Optional array of filter objects. Only applies to 'read' actions.

Ext.data.Operation
view source
group : Object

Optional grouping configuration. Only applies to 'read' actions where grouping is desired.

Optional grouping configuration. Only applies to 'read' actions where grouping is desired.

Ext.data.Operation
view source
limit : Number

The number of records to load. Used on 'read' actions when paging is being used.

The number of records to load. Used on 'read' actions when paging is being used.

Ext.data.Operation
view source
sorters : Array

Optional array of sorter objects. Only applies to 'read' actions.

Optional array of sorter objects. Only applies to 'read' actions.

Ext.data.Operation
view source
start : Number

The start index (offset), used in paging when running a 'read' action.

The start index (offset), used in paging when running a 'read' action.

Ext.data.Operation
view source
synchronous : Boolean
True if this Operation is to be executed synchronously (defaults to true). This property is inspected by a Batch to s...

True if this Operation is to be executed synchronously (defaults to true). This property is inspected by a Batch to see if a series of Operations can be executed in parallel or not.

Defined By

### Methods

Ext.data.Operation
view source
Operation( Object config) : void

### Parameters

- config : Object

  Optional config object

### Returns

- void

Ext.data.Operation
view source
allowWrite : Boolean

Checks whether this operation should cause writing to occur.

Checks whether this operation should cause writing to occur.

### Returns

- Boolean

  Whether the operation should cause a write to occur.

Ext.data.Operation
view source
getError : Mixed

Returns the error string or object that was set using setException

Returns the error string or object that was set using setException

### Returns

- Mixed

  The error object

Ext.data.Operation
view source
getRecords : Array

Returns an array of Ext.data.Model instances as set by the Proxy.

Returns an array of Ext.data.Model instances as set by the Proxy.

### Returns

- Array

  Any loaded Records

Ext.data.Operation
view source
getResultSet : Ext.data.ResultSet
Returns the ResultSet object (if set by the Proxy). This object will contain the model instances as well as meta data...

Returns the ResultSet object (if set by the Proxy). This object will contain the model instances as well as meta data such as number of instances fetched, number available etc

### Returns

- Ext.data.ResultSet

  The ResultSet object

Ext.data.Operation
view source
hasException : Boolean

Returns true if this Operation encountered an exception (see also getError)

Returns true if this Operation encountered an exception (see also getError)

### Returns

- Boolean

  True if there was an exception

Ext.data.Operation
view source
isComplete : Boolean

Returns true if the Operation has been completed

Returns true if the Operation has been completed

### Returns

- Boolean

  True if the Operation is complete

Ext.data.Operation
view source
isRunning : Boolean

Returns true if the Operation has been started but has not yet completed.

Returns true if the Operation has been started but has not yet completed.

### Returns

- Boolean

  True if the Operation is currently running

Ext.data.Operation
view source
isStarted : Boolean
Returns true if the Operation has been started. Note that the Operation may have started AND completed, see isRunning...

Returns true if the Operation has been started. Note that the Operation may have started AND completed, see isRunning to test if the Operation is currently running.

### Returns

- Boolean

  True if the Operation has started

Ext.data.Operation
view source
setCompleted : void

Marks the Operation as completed

Marks the Operation as completed

### Returns

- void

Ext.data.Operation
view source
setException( Mixed error) : void

Marks the Operation as having experienced an exception. Can be supplied with an option error message/object.

Marks the Operation as having experienced an exception. Can be supplied with an option error message/object.

### Parameters

- error : Mixed

  Optional error string/object

### Returns

- void

Ext.data.Operation
view source
setStarted : void

Marks the Operation as started

Marks the Operation as started

### Returns

- void

Ext.data.Operation
view source
setSuccessful : void

Marks the Operation as successful

Marks the Operation as successful

### Returns

- void

Ext.data.Operation
view source
wasSuccessful : Boolean

Returns true if the Operation has completed and was successful

Returns true if the Operation has completed and was successful

### Returns

- Boolean

  True if successful