Sencha Documentation

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.

Config Options

 
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'
 
batch : Ext.data.Batch
The batch that this Operation is a part of (optional)
The batch that this Operation is a part of (optional)
 
filters : Array
Optional array of filter objects. Only applies to 'read' actions.
Optional array of filter objects. Only applies to 'read' actions.
 
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.
 
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.
 
sorters : Array
Optional array of sorter objects. Only applies to 'read' actions.
Optional array of sorter objects. Only applies to 'read' actions.
 
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.
 
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.

Methods

 
allowWrite : Boolean
Checks whether this operation should cause writing to occur.
Checks whether this operation should cause writing to occur.
 
getError : Mixed
Returns the error string or object that was set using setException
Returns the error string or object that was set using setException
 
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.
 
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
 
hasException : Boolean
Returns true if this Operation encountered an exception (see also getError)
Returns true if this Operation encountered an exception (see also getError)
 
isComplete : Boolean
Returns true if the Operation has been completed
Returns true if the Operation has been completed
 
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.
 
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.
 
Marks the Operation as completed
Marks the Operation as completed
 
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
 
setStarted : Void
Marks the Operation as started
Marks the Operation as started
 
Marks the Operation as successful
Marks the Operation as successful
 
wasSuccessful : Boolean
Returns true if the Operation has completed and was successful
Returns true if the Operation has completed and was successful