Properties Methods Events Config Options Direct Link
Observable
  Store
    JsonStore

Class Ext.data.JsonStore

Package:Ext.data
Defined In:JsonStore.js
Class:JsonStore
Extends:Store

Small helper class to make creating Ext.data.Stores from JSON data easier. A JsonStore will be automatically configured with a Ext.data.JsonReader.

A store configuration would be something like:

var store = new Ext.data.JsonStore({
    // store configs
    autoDestroy: true,
    url: 'get-images.php',
    storeId: 'myStore',
    // reader configs
    root: 'images',
    idProperty: 'name',
    fields: ['name', 'url', {name:'size', type: 'float'}, {name:'lastmod', type:'date'}]
});

This store is configured to consume a returned object of the form:

{
    images: [
        {name: 'Image one', url:'/GetImage.php?id=1', size:46.5, lastmod: new Date(2007, 10, 29)},
        {name: 'Image Two', url:'/GetImage.php?id=2', size:43.2, lastmod: new Date(2007, 10, 30)}
    ]
}
An object literal of this form could also be used as the data config option.

*Note: Although not listed here, this class accepts all of the configuration options of JsonReader.

Config Options

Config OptionsDefined By
 data : Array
An inline data object readable by the reader. Typically this option, or the url option will be specified.
Store
 proxy : Ext.data.DataProxy
The DataProxy object which provides access to a data object. See url.
Store

Public Properties

PropertyDefined By
 fields : Ext.util.MixedCollection
A MixedCollection containing the defined Fields for the Records stored in this Store. Read-only.
Store
 isDestroyed : Boolean True if the store has been destroyed already. Read only
Store
 multiSort : Boolean True if this store is currently sorted by more than one field/direction combination.
Store
 multiSortInfo : Object
Object containing overall sort direction and an ordered array of sorter configs used when sorting on multiple fields
Store

Public Methods

MethodDefined By

Public Events

EventDefined By