|
| Record( [Object data ], [Object id ] )
+ This constructor should not be used to create Record objects. Instead, use create to
generate a subclass of Ext.data.... This constructor should not be used to create Record objects. Instead, use create to
generate a subclass of Ext.data.Record configured with information about its constituent fields.
The generated constructor has the same signature as this constructor. Parameters:data : Object(Optional) An object, the properties of which provide values for the new Record's
fields. If not specified the defaultValue
-for each field will be assigned. id : Object(Optional) The id of the Record. This id should be unique, and is used by the
- Ext.data.Store object which owns the Record to index its collection of Records. If
-an id is not specified a phantom Record will be created
-with an automatically generated id. Returns: | Record |
| Record.id( Record rec )
- :
- StringGenerates a sequential id. This method is typically called when a record is created
+for each field will be assigned. id : Object(Optional) The id of the Record. The id is used by the
+ Ext.data.Store object which owns the Record to index its collection
+of Records (therefore this id should be unique within each store). If an
+ id is not specified a phantom
+Record will be created with an automatically generated id. Returns: | Record |
| Record.id( Record rec )
+ :
+ StringGenerates a sequential id. This method is typically called when a record is created
and no id has been specified. The... Generates a sequential id. This method is typically called when a record is created
and no id has been specified. The returned id takes the form:
{PREFIX}-{AUTO_ID}. Parameters:rec : RecordThe record being created. The record does not exist, it's a phantom. Returns: | Record |
| beginEdit()
- :
- voidBegin an edit. While in edit mode, no events (e.g.. the update event)
-are relayed to the containing store.
+ Parameters:rec : RecordThe record being created. The record does not exist, it's a phantom. Returns: | Record |
| beginEdit()
+ :
+ voidBegin an edit. While in edit mode, no events (e.g.. the update event)
+are relayed to the containing store.
See also: ... Begin an edit. While in edit mode, no events (e.g.. the update event)
are relayed to the containing store.
-See also: endEdit and cancelEdit . | Record |
| cancelEdit()
- :
- voidCancels all changes made in the current edit operation. Cancels all changes made in the current edit operation. | Record |
| commit( [Boolean silent ] )
- :
- voidUsually called by the Ext.data.Store which owns the Record.
+See also: endEdit and cancelEdit . | Record |
| cancelEdit()
+ :
+ voidCancels all changes made in the current edit operation. Cancels all changes made in the current edit operation. | Record |
| commit( [Boolean silent ] )
+ :
+ voidUsually 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. | Record |
| copy( [String id ] )
- :
- RecordCreates a copy of this Record. Creates a copy of this Record. Parameters:id : String(optional) A new Record id, defaults to autogenerating an id.
-Note: if an id is not specified the copy created will be a
- phantom Record. Returns: | Record |
| create( Array o )
- :
- function<static> Generate a constructor for a specific Record layout. <static> Generate a constructor for a specific Record layout. Parameters:o : ArrayAn Array of Field definition objects.
+store of the change (defaults to false) Returns: | Record |
| copy( [String id ] )
+ :
+ RecordCreates a copy (clone) of this Record. Creates a copy (clone) of this Record. Parameters:id : String(optional) A new Record id, defaults to the id
+of the record being copied. See id .
+To generate a phantom record with a new id use: var rec = record.copy(); // clone the record
+Ext.data.Record.id(rec); // automatically generate a unique sequential id
Returns: | Record |
| create( Array o )
+ :
+ Function<static> Generate a constructor for a specific Record layout. <static> Generate a constructor for a specific Record layout. Parameters:o : ArrayAn Array of Field definition objects.
The constructor generated by this method may be used to create new Record instances. The data
object must contain properties named after the field
Ext.data.Field.names. Example usage: // create a Record constructor from a description of the fields
@@ -91,48 +97,48 @@ object must contain properties named after the one is auto-assigned
);
-myStore.add(myNewRecord);
Returns: | Record |
| endEdit()
- :
- voidEnd an edit. If any data was modified, the containing store is notified
+myStore. add(myNewRecord); Returns: | Record |
| endEdit()
+ :
+ voidEnd an edit. If any data was modified, the containing store is notified
(ie, the store's update event will fire). End an edit. If any data was modified, the containing store is notified
-(ie, the store's update event will fire). | Record |
| get( String name )
- :
- ObjectGet the value of the named field. Get the value of the named field. Parameters:Returns:Object The value of the field.
| Record |
| getChanges()
- :
- ObjectGets 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. | Record |
| isModified( String fieldName )
- :
- BooleanReturns true if the passed field name has been modified
+(ie, the store's update event will fire). | Record |
| get( String name )
+ :
+ ObjectGet the value of the named field. Get the value of the named field. Parameters:Returns:Object The value of the field.
| Record |
| getChanges()
+ :
+ ObjectGets 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. | Record |
| isModified( String fieldName )
+ :
+ BooleanReturns true if the passed field name has been modified
since the load or last commit. Returns true if the passed field name has been modified
-since the load or last commit. | Record |
| isValid()
- :
- BooleanBy default returns false if any field within the
-record configured with Ext.data.Field.allowBlank = false returns
+since the load or last commit. | Record |
| isValid()
+ :
+ BooleanBy default returns false if any field within the
+record configured with Ext.data.Field.allowBlank = false returns
tru... | Record |
| markDirty()
- :
- voidMarks this Record as dirty. This method
-is used interally when adding phantom records to a
-writer enabled store.
+ true from an Ext. isempty test. | Record |
| markDirty()
+ :
+ voidMarks this Record as dirty. This method
+is used interally when adding phantom records to a
+writer enabled store.
Mar... | Record |
| reject( [Boolean silent ] )
- :
- voidUsually called by the Ext.data.Store which owns the Record.
+operations. | Record |
| reject( [Boolean silent ] )
+ :
+ voidUsually 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. | Record |
| set( String name , Object value )
- :
- voidSet the named field to the specified value. For example:
-// record has a field named 'firstname'
+store of the change (defaults to false) Returns: | Record |
| set( String name , String/Object/Array value )
+ :
+ voidSet the named field to the specified value. For example:
+// record has a field named 'firstname'
var Employee = Ext.... Set the named field to the specified value. For example:
// record has a field named 'firstname'
var Employee = Ext.data.Record.create([
@@ -151,7 +157,7 @@ rec.modified records
-rec.data['firstname'] = 'Wilma'); // updates record, but not the view
+rec.data['firstname'] = 'Wilma'; // updates record, but not the view
rec.commit(); // updates the view
Notes:
- If the store has a writer and
autoSave=true , each set()
@@ -160,4 +166,4 @@ will execute an XHR to the server.
event firing while using set().
- Use
endEdit to have the store's update
event fire.
- | Record |