X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/d41dc04ad17d1d9125fb2cf72db2b4782dbe3a8c..7a654f8d43fdb43d78b63d90528bed6e86b608cc:/docs/output/Ext.data.JsonReader.html diff --git a/docs/output/Ext.data.JsonReader.html b/docs/output/Ext.data.JsonReader.html deleted file mode 100644 index 5c49b9a2..00000000 --- a/docs/output/Ext.data.JsonReader.html +++ /dev/null @@ -1,238 +0,0 @@ -
-
- Properties - Methods - Events - Config Options - Direct Link -
-
-
DataReader
-  JsonReader
-

Class Ext.data.JsonReader

- - - - - - -
Package:Ext.data
Defined In:JsonReader.js
Class:JsonReader
Subclasses:ArrayReader
Extends:DataReader
-
- * -Data reader class to create an Array of Ext.data.Record objects from a JSON response -based on mappings in a provided Ext.data.Record constructor.
-

-Example code: -

var Employee = Ext.data.Record.create([
-    {name: 'firstname'},                  // Map the Record's "firstname" field to the row object's key of the same name
-    {name: 'job', mapping: 'occupation'}  // Map the "job" field to the row object's "occupation" key
-]);
-var myReader = new Ext.data.JsonReader({
-    totalProperty: "results",             // The property which contains the total dataset size (optional)
-    root: "rows",                         // The property which contains an Array of row objects
-    id: "id"                              // The property within each row object that provides an ID for the record (optional)
-}, Employee);
-

-This would consume a JSON object of the form: -

{
-    results: 2,
-    rows: [
-        { id: 1, firstname: 'Bill', occupation: 'Gardener' },         // a row object
-        { id: 2, firstname: 'Ben' , occupation: 'Horticulturalist' }  // another row object
-    ]
-}
-

It is possible to change a JsonReader's metadata at any time by including a -metaData property in the data object. If this is detected in the -object, a Store object using this Reader will reconfigure -itself to use the newly provided field definition and fire its -metachange event. In -undergoing this change, the Store sets its sortInfo property -from the sortInfo property in the new metadata. Note that reconfiguring a Store -potentially invalidates objects which may refer to Fields or Records which no longer exist.

-

The metaData property may contain any of the configuration -options for this class. Additionally, it may contain a fields -property which the JsonReader will use as an argument to Ext.data.Record.create -to configure the layout of the Records which it will produce.

-Using the metaData property, and the Store's metachange event, -it is possible to have a Store-driven control initialize itself. The metachange -event handler may interrogate the metaData property (which -may contain any user-defined properties needed) and the metaData.fields -property to perform any configuration required.

-

To use this facility to send the same data as the above example without -having to code the creation of the Record constructor, you would create the -JsonReader like this:

var myReader = new Ext.data.JsonReader();
-

The first data packet from the server would configure the reader by -containing a metaData property as well as the data:

{
-    metaData: {
-        totalProperty: 'results',
-        root: 'rows',
-        id: 'id',
-        fields: [
-            {name: 'name'},
-            {name: 'occupation'}
-        ]
-    },
-    results: 2,
-    rows: [
-        { 'id': 1, 'name': 'Bill', occupation: 'Gardener' },
-        { 'id': 2, 'name': 'Ben', occupation: 'Horticulturalist' }
-    ]
-}
- -
- -

Config Options

- - - - - - - - - - - - - - - - - - - - - - - - - -
Config OptionsDefined By
  - - id : String
- Name of the property within a row object that contains a record identifier value.
-
JsonReader
  - - root : String
- name of the property which contains the Array of row objects.
-
JsonReader
  - - successProperty : String
- Name of the property from which to retrieve the success attribute used by forms.
-
JsonReader
- -

Public Properties

- - - - - - - - - - - - - - - -
PropertyDefined By
  - - meta : Mixed
- This JsonReader's metadata as passed to the constructor, or as passed in -the last data packet's metaData property.
-
JsonReader
- -

Public Methods

- - - - - - - - - - - - - - - - - - - - -
MethodDefined By
- -

Public Events

-
This class has no public events.
-
\ No newline at end of file