Clear Up
SharpKit Reference

Json Class

This class is used to write Ext.data.Model data to the server in a JSON format. The allowSingle configuration can be set to false to force the records to always be encoded in an array, even if there is only a single record being sent.

Namespace: Ext.data.writer

Constructors

Fields

Name Description
allowSingle False to ensure that records are always wrapped in an array, even if there is only one record being sent. When there is more than one record, they will always be encoded into an array. Defaults to true. Example:
// with allowSingle: true
            "root": {
            "first": "Mark",
            "last": "Corrigan"
            }
            // with allowSingle: false
            "root": [{
            "first": "Mark",
            "last": "Corrigan"
            }]
            
Defaults to: true
encode True to use Ext.encode() on the data before sending. Defaults to false. The encode option should only be set to true when a root is defined, because the values will be sent as part of the request parameters as opposed to a raw post. The root will be the name of the parameter sent to the server. Defaults to: false
root The key under which the records in this Writer will be placed. Defaults to undefined. Example generated request, using root: 'records':
{'records': [{name: 'my record'}, {name: 'another record'}]}
            
© Copyright 2005-2011 SharpKit. All rights reserved.