Package: | Ext.data |
Defined In: | Record.js |
Class: | Record |
Extends: | Object |
Instances of this class encapsulate both Record definition information, and Record value information for use in Ext.data.Store objects, or any code which needs to access Records cached in an Ext.data.Store object.
Constructors for this class are generated by passing an Array of field definition objects to create. Instances are usually only created by Ext.data.Reader implementations when processing unformatted data objects.
Note that an instance of a Record class may only belong to one Store at a time. In order to copy data from one Store to another, use the copy method to create an exact copy of the Record, and insert the new instance into the other Store.
When serializing a Record for submission to the server, be aware that it contains many private properties, and also a reference to its owning Store which in turn holds references to its Records. This means that a Record may not be encoded using Ext.util.JSON.encode. Instead, use the data and id properties.
Record objects generated by this constructor inherit all the methods of Ext.data.Record listed below.Property | Defined By | |
---|---|---|
data : Object
An object hash representing the data for this Record. Every field name in the Record definition
is represented by a ...
An object hash representing the data for this Record. Every field name in the Record definition
is represented by a property of that name in this object. Note that unless you specified a field
with name "id" in the Record definition, this will not contain an id property.
|
Record | |
dirty : Boolean
Readonly flag - true if this Record has been modified.
|
Record | |
fields : Ext.util.MixedCollection This property is stored in the Record definition's prototype
A MixedCollection containing the defined Fields for this...
This property is stored in the Record definition's prototype A MixedCollection containing the defined Fields for this Record. Read-only. |
Record | |
id : Object
The unique ID of the Record as specified at construction time.
|
Record | |
modified : Object This object contains a key and value storing the original values of all modified fields or is null if no fields have ...
This object contains a key and value storing the original values of all modified fields or is null if no fields have been modified.
|
Record |
Method | Defined By | |
---|---|---|
Record( Array data , [Object id ] ) This constructor should not be used to create Record objects. Instead, use the constructor generated by
create. The p...
This constructor should not be used to create Record objects. Instead, use the constructor generated by
create. The parameters are the same.
Parameters:
|
Record | |
beginEdit() : void Begin an edit. While in edit mode, no events are relayed to the containing store.
Begin an edit. While in edit mode, no events are relayed to the containing store.
Parameters:
|
Record | |
cancelEdit() : void Cancels all changes made in the current edit operation.
Cancels all changes made in the current edit operation.
Parameters:
|
Record | |
commit( [Boolean silent ] ) : void Usually called by the Ext.data.Store which owns the Record.
Commits all changes made to the Record since either creat...
Usually called by the Ext.data.Store which owns the Record.
Commits all changes made to the Record since either creation, or the last commit operation.
Developers should subscribe to the Ext.data.Store.update event to have their code notified of commit operations.
Parameters:
|
Record | |
copy( [String id ] ) : Record Creates a copy of this Record.
Creates a copy of this Record.
Parameters:
|
Record | |
create( [Array o ] ) : function <static> Generate a constructor for a specific Record layout.
<static> Generate a constructor for a specific Record layout.
Parameters:
|
Record | |
endEdit() : void End an edit. If any data was modified, the containing store is notified.
End an edit. If any data was modified, the containing store is notified.
Parameters:
|
Record | |
get( String name ) : Object Get the value of the named field.
Get the value of the named field.
Parameters:
|
Record | |
getChanges() : Object Gets a hash of only the fields that have been modified since this Record was created or commited.
Gets a hash of only the fields that have been modified since this Record was created or commited.
Parameters:
|
Record | |
isModified( String fieldName ) : Boolean Returns true if the field passed has been modified since the load or last commit.
Returns true if the field passed has been modified since the load or last commit.
Parameters:
|
Record | |
reject( [Boolean silent ] ) : void Usually called by the Ext.data.Store which owns the Record.
Rejects all changes made to the Record since either creat...
Usually called by the Ext.data.Store which owns the Record.
Rejects all changes made to the Record since either creation, or the last commit operation.
Modified fields are reverted to their original values.
Developers should subscribe to the Ext.data.Store.update event to have their code notified of reject operations.
Parameters:
|
Record | |
set( String name , Object value ) : void Set the named field to the specified value.
Set the named field to the specified value.
Parameters:
|
Record |