Properties Methods Events Config Options Direct Link

    DataWriter
      JsonWriter

# Class Ext.data.JsonWriter

Package: | Ext.data
Defined In: | JsonWriter.js
Class: | JsonWriter
Extends: | DataWriter

DataWriter extension for writing an array or single Ext.data.Record object(s) in preparation for executing a remote CRUD action.

## Config Options

Config Options | Defined By
--- | ---
| createRecord : Function 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) | DataWriter
| encode : Boolean true to encode the hashed data. Defaults to true. When using Ext.data.DirectProxy, set this to false since Ext.Direc... `true` to encode the hashed data. Defaults to `true`. When using Ext.data.DirectProxy, set this to `false` since Ext.Direct.JsonProvider will perform its own json-encoding. In addition, if you're using Ext.data.HttpProxy, setting to `false` will cause HttpProxy to transmit data using the jsonData configuration-params of Ext.Ajax.request instead of params. When using a 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: Ext.Ajax) do the encoding. | 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
| returnJson : Boolean Deprecated. Use Ext.data.JsonWriter.encode instead. | JsonWriter
| updateRecord : Function 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

## Public Properties

This class has no public properties.

## Public Methods

Method | Defined By
--- | ---
| createRecord( `Ext.data.Record rec` ) : Object Implements abstract Ext.data.DataWriter#createRecord Implements abstract Ext.data.DataWriter#createRecord Parameters: `rec` : Ext.data.Record Returns: `Object` | JsonWriter
| destroyRecord( `Ext.data.Record rec` ) : Object Implements abstract Ext.data.DataWriter#destroyRecord Implements abstract Ext.data.DataWriter#destroyRecord Parameters: `rec` : Ext.data.Record Returns: `Object` | JsonWriter
| render( `String action`, `Record[] rs`, `Object http`, `Object data` ) : void Final action of a write event. Apply the written data-object to params. Final action of a write event. Apply the written data-object to params. Parameters: `action` : String [Ext.data.Api.actions.create|read|update|destroy] `rs` : Record[] `http` : Object params `data` : Object object populated according to DataReader meta-data "root" and "idProperty" Returns: void | JsonWriter
| updateRecord( `Ext.data.Record rec` ) : Object Implements abstract Ext.data.DataWriter#updateRecord Implements abstract Ext.data.DataWriter#updateRecord Parameters: `rec` : Ext.data.Record Returns: `Object` | JsonWriter
| write( `String action`, `Object params`, `Record/Record[] rs` ) : void Writes data in preparation for server-write action. Simply proxies to DataWriter#update, DataWriter#create DataWrite... Writes data in preparation for server-write action. Simply proxies to DataWriter#update, DataWriter#create DataWriter#destroy. Parameters: `action` : String [CREATE|UPDATE|DESTROY] `params` : Object The params-hash to write-to `rs` : Record/Record[] The recordset write. Returns: void | DataWriter

## Public Events

This class has no public events.