DataWriterJsonWriter
| Package: | CQ.Ext.data |
| Class: | JsonWriter |
| Extends: | CQ.Ext.data.DataWriter |
| Clientlib: | cq.widgets |
| Config Options | Defined By | |
|---|---|---|
|
createRecord : Function Abstract method that should be implemented in all subclasses (e.g.: JsonWriter.createRecord)
Abstract method that should be implemented in all subclasses (e.g.: JsonWriter.createRecord)
|
DataWriter | |
|
destroyRecord : Function Abstract method that should be implemented in all subclasses (e.g.: JsonWriter.destroyRecord)
Abstract method that should be implemented in all subclasses (e.g.: JsonWriter.destroyRecord)
|
DataWriter | |
|
encode : Boolean true to JSON encode the hashed data into a standard HTTP parameter named after this Reader's meta.root property which...
true to JSON encode the hashed data into a standard HTTP parameter named after this Reader's If set to When using CQ.Ext.data.DirectProxy, set this to false since CQ.Ext.Direct.JsonProvider will perform its own json-encoding. In addition, if you're using CQ.Ext.data.HttpProxy, setting to false will cause HttpProxy to transmit data using the jsonData configuration-params of CQ.Ext.Ajax.request instead of params. When using a CQ.Ext.data.Store.restful Store, some serverside frameworks are tuned to expect data through the jsonData mechanism. In those cases, one will want to set encode: false, as in let the lower-level connection object (eg: CQ.Ext.Ajax) do the encoding. |
JsonWriter | |
|
encodeDelete : Boolean False to send only the id to the server on delete, true to encode it in an object literal, eg: {id: 1} Defaults to false
False to send only the id to the server on delete, true to encode it in an object literal, eg:
Defaults to false |
JsonWriter | |
|
listful : Boolean false by default. Set true to have the DataWriter always write HTTP params as a list, even when acting upon a single ...
false by default. Set true to have the DataWriter always write HTTP params as a list, even when acting upon a single record.
|
DataWriter | |
|
updateRecord : Function Abstract method that should be implemented in all subclasses (e.g.: JsonWriter.updateRecord
Abstract method that should be implemented in all subclasses (e.g.: JsonWriter.updateRecord
|
DataWriter | |
|
writeAllFields : Boolean false by default. Set true to have DataWriter return ALL fields of a modified record -- not just those that changed. ...
false by default. Set true to have DataWriter return ALL fields of a modified record -- not just those that changed. false to have DataWriter only request modified fields from a record.
|
DataWriter | |
| Property | Defined By | |
|---|---|---|
|
render : Object abstract method meant to be overridden by all DataWriter extensions. It's the extension's job to apply the "data" to...
abstract method meant to be overridden by all DataWriter extensions. It's the extension's job to apply the "data" to the "params".
The data-object provided to render is populated with data according to the meta-info defined in the user's DataReader config,
|
DataWriter | |
| Method | Defined By | |
|---|---|---|
apply( Object params, Object baseParams, String action, Record/Record[] rs ) : void Compiles a Store recordset into a data-format defined by an extension such as CQ.Ext.data.JsonWriter or CQ.Ext.data.X...
Compiles a Store recordset into a data-format defined by an extension such as CQ.Ext.data.JsonWriter or CQ.Ext.data.XmlWriter in preparation for a server-write action. The first two params are similar similar in nature to CQ.Ext.apply,
Where the first parameter is the receiver of paramaters and the second, baseParams, the source.
Parameters:
|
DataWriter | |
createRecord( CQ.Ext.data.Record rec ) : Object Implements abstract CQ.Ext.data.DataWriter#createRecord
@protected
Implements abstract CQ.Ext.data.DataWriter#createRecord
@protected
Parameters:
|
JsonWriter | |
destroyRecord( CQ.Ext.data.Record rec ) : Object Implements abstract CQ.Ext.data.DataWriter#destroyRecord
@protected
Implements abstract CQ.Ext.data.DataWriter#destroyRecord
@protected
Parameters:
|
JsonWriter | |
render( Object Ajax, Object baseParams, Object/Object[] data ) : void This method should not need to be called by application code, however it may be useful on occasion to
override it, or...
This method should not need to be called by application code, however it may be useful on occasion to override it, or augment it with an interceptor or sequence. The provided implementation encodes the serialized data representing the Store's modified Records into the Ajax request's
Parameters:
|
JsonWriter | |
toArray( Hash data ) : Array Converts a Hashed CQ.Ext.data.Record to fields-array array suitable
for encoding to xml via XTemplate, eg:
<tpl f...
Converts a Hashed CQ.Ext.data.Record to fields-array array suitable
for encoding to xml via XTemplate, eg:
eg, non-phantom:
Phantom records will have had their idProperty omitted in toHash if determined to be auto-generated.
Non AUTOINCREMENT pks should have been protected.
Parameters:
|
DataWriter | |
toHash( CQ.Ext.data.Record rec, Object config ) : Object Converts a Record to a hash, taking into account the state of the CQ.Ext.data.Record along with configuration propert...
Converts a Record to a hash, taking into account the state of the CQ.Ext.data.Record along with configuration properties
related to its rendering, such as writeAllFields, phantom, getChanges and
idProperty
Parameters:
|
DataWriter | |
updateRecord( CQ.Ext.data.Record rec ) : Object Implements abstract CQ.Ext.data.DataWriter#updateRecord
@protected
Implements abstract CQ.Ext.data.DataWriter#updateRecord
@protected
Parameters:
|
JsonWriter | |