Clear Up
SharpKit Reference

Writer Class

Base Writer class used by most subclasses of This class is responsible for taking a set of objects and a object and modifying that request based on the Operations.

For example a would format the Operations and their instances based on the config options passed to the JsonWriter's constructor.

Writers are not needed for any kind of local storage - whether via a Web Storage proxy (see localStorage and sessionStorage) or just in memory via a MemoryProxy.


Base Types


Name Description
Writer(object) Creates new Writer.


Name Description
getRecordData(Model, object) Formats the data for each record before sending it to the server. This method should be overridden to format the data in a way that differs from the default.
write(Request) Prepares a Proxy's object


Name Description
nameProperty This property is used to read the key for each value that will be sent to the server. For example:
  Ext.define('Person', {
            extend: '',
            fields: [{
            name: 'first',
            mapping: 'firstName'
            }, {
            name: 'last',
            mapping: 'lastName'
            }, {
            name: 'age'
            writeAllFields: true,
            nameProperty: 'mapping'
            // This will be sent to the server
            firstName: 'first name value',
            lastName: 'last name value',
            age: 1
If the value is not present, the field name will always be used. Defaults to: "name"
writeAllFields True to write all fields from the record to the server. If set to false it will only send the fields that were modified. Note that any fields that have set to false will still be ignored. Defaults to: true
© Copyright 2005-2011 SharpKit. All rights reserved.