RecordSlingRecord
| Package: | CQ.data |
| Class: | SlingRecord |
| Extends: | CQ.Ext.data.Record |
| Clientlib: | cq.widgets |
Constructors for this class are generated by passing an Array of field definition objects to create.
Instances are usually only created by CQ.Ext.data.SlingReader implementations when processing unformatted data
objects.
| 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 : CQ.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 | |
|
json : Array|Object
Only present if this Record was created by an ArrayReader or a JsonReader.
The Array or object which was the source ...
Only present if this Record was created by an ArrayReader or a JsonReader. The Array or object which was the source of the data for this Record. |
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 | |
|
node : XMLElement
Only present if this Record was created by an XmlReader.
The XML element which was the source of the data for this R...
Only present if this Record was created by an XmlReader. The XML element which was the source of the data for this Record. |
Record | |
|
phantom : Boolean true when the record does not yet exist in a server-side database (see
markDirty). Any record which has a real datab...
true 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 : CQ.Ext.data.Store
The CQ.Ext.data.Store to which this Record belongs.
|
Record | |
| Method | Defined By | |
|---|---|---|
SlingRecord( Array data, [Object id] ) This constructor should not be used to create SlingRecord objects. Instead, use the constructor generated by
create. ...
This constructor should not be used to create SlingRecord objects. Instead, use the constructor generated by
create. The parameters are the same.
Parameters:
|
SlingRecord | |
|
beginEdit() : void Begin 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.
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 CQ.Ext.data.Store which owns the Record.
Commits all changes made to the Record since either cr...
Usually called by the CQ.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 CQ.Ext.data.Store.update event to have their code notified of commit operations.
Parameters:
|
Record | |
copy( [String id] ) : Record Creates a copy (clone) of this Record.
Creates a copy (clone) of this Record.
Parameters:
|
Record | |
create( String[] o, String url ) : function <static> Generate a constructor for a specific record layout.
<static> Generate a constructor for a specific record layout.
Parameters:
|
SlingRecord | |
|
endEdit() : void End 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).
Parameters:
|
Record | |
get( String name ) : Object Get the value of the named field.
Get the value of the named field.
Parameters:
|
SlingRecord | |
|
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
|
Record | |
|
isValid() : Boolean By default returns false if any field within the
record configured with CQ.Ext.data.Field.allowBlank = false returns
...
By default returns false if any field within the
record configured with CQ.Ext.data.Field.allowBlank = false returns
true from an CQ.Ext.isempty test.
Parameters:
|
Record | |
|
markDirty() : void Marks this Record as dirty. This method
is used interally when adding phantom records to a
writer enabled store.
Mar...
Marks this Record as Marking a record
Parameters:
|
Record | |
reject( [Boolean silent] ) : void Usually called by the CQ.Ext.data.Store which owns the Record.
Rejects all changes made to the Record since either cr...
Usually called by the CQ.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 CQ.Ext.data.Store.update event to have their code notified of reject operations.
Parameters:
|
Record | |
set( String name, String/Object/Array value ) : void Set the named field to the specified value. For example:
// record has a field named 'firstname'
var Employee = CQ.E...
Set the named field to the specified value. For example:
Notes:
Parameters:
|
Record | |