- |
-
-
- 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
+This means that a whole 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. Public Properties|
| data : ObjectAn object hash representing the data for this Record. Every field name in the Record definition
+is represented by a p... 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 |
-
-
-
- Public Methods
-
-
-
-
-
-
- |
-
-
- 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:
-
- Returns:
-
-
-
-
- |
- 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:
-
- Returns:
-
-
-
-
- |
- Record |
-
-
- |
-
-
- cancelEdit() : void
- Cancels all changes made in the current edit operation.
-
- Cancels all changes made in the current edit operation.
- Parameters:
-
- Returns:
-
-
-
-
- |
- 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.
+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.MixedCollectionThis 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 | Record | | modified : ObjectThis 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 | | phantom : Booleanfalse when the record does not yet exist in a server-side database (see
+markDirty). Any record which has a real data... false when the record does not yet exist in a server-side database (see
+ markDirty). Any record which has a real database pk set as its id property
+is NOT a phantom -- it's real. | Record | | store : Ext.data.Store | Record | Public Methods|
| 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
+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.
+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.
+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:
-
- Returns:
-
-
-
-
- |
- Record |
-
-
- |
-
-
- copy( [String id ] ) : Record
- Creates a copy of this Record.
-
- Creates a copy of this Record.
- Parameters:
-
- 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 which specify field names, and optionally,
-data types, and a mapping for an Ext.data.Reader to extract the field's value from a data object.
-Each field definition object may contain the following properties:
-The constructor generated by this method may be used to create new Record instances. The data object must contain properties
-named after the field names.
- usage: var TopicRecord = Ext.data.Record.create([
- {name: 'title', mapping: 'topic_title'},
- {name: 'author', mapping: 'username'},
+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.
+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
+var TopicRecord = Ext.data.Record.create([ // creates a subclass of Ext.data.Record
+ {name: 'title', mapping: 'topic_title'},
+ {name: 'author', mapping: 'username', allowBlank: false},
{name: 'totalPosts', mapping: 'topic_replies', type: 'int'},
{name: 'lastPost', mapping: 'post_time', type: 'date'},
{name: 'lastPoster', mapping: 'user2'},
- {name: 'excerpt', mapping: 'post_text'}
+ {name: 'excerpt', mapping: 'post_text', allowBlank: false},
+ // In the simplest case, if no properties other than name are required,
+ // a field definition may consist of just a String for the field name.
+ 'signature'
]);
-var myNewRecord = new TopicRecord({
- title: 'Do my job please',
- author: 'noobie',
- totalPosts: 1,
- lastPost: new Date(),
- lastPoster: 'Animal',
- excerpt: 'No way dude!'
-});
-myStore.add(myNewRecord);
- In the simplest case, if no properties other than name are required, a field definition
-may consist of just a field name string.
- Returns:
-
-
-
-
- |
- 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:
-
- Returns:
-
-
-
-
- |
- Record |
-
-
- |
-
-
- get( String name ) : Object
- Get the value of the named field.
-
- Get the value of the named field.
- Parameters:
-
- Returns:
-
- Object The value of the field.
-
-
-
-
- |
- 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:
-
- Returns:
-
-
-
-
- |
- 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:
-
- Returns:
-
-
-
-
- |
- 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.
+ // create Record instance
+ var myNewRecord = new TopicRecord(
+ {
+ title: 'Do my job please',
+ author: 'noobie',
+ totalPosts: 1,
+ lastPost: new Date(),
+ lastPoster: 'Animal',
+ excerpt: 'No way dude!',
+ signature: ''
+ },
+ id // optionally specify the id of the record otherwise one is auto-assigned
+);
+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
+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
+tru... | 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.
+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:
-
- Returns:
-
-
-
-
- |
- Record |
-
-
- |
-
-
- set( String name , Object value ) : void
- Set the named field to the specified value.
-
- Set the named field to the specified value.
- Parameters:
-
- Returns:
-
-
-
-
- |
- Record |
-
-
-
- Public Events
- This class has no public events.
-
\ No newline at end of file
+Developers should subscribe to the Ext.data.Store.update event
+to have their code notified of reject operations. | Record |