Properties Methods Events Config Options Direct Link
Observable
  Store
    JsonStore

Class CQ.Ext.data.JsonStore

Package:CQ.Ext.data
Class:JsonStore
Extends:CQ.Ext.data.Store
Clientlib:cq.widgets
xtype:jsonstore

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

A store configuration would be something like:

var store = new CQ.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 Options Defined By

Public Properties

Property Defined By
  baseParams : Object
See the corresponding configuration option for a description of this property. To modify this property see setBaseParam.
Store
  fields : CQ.Ext.util.MixedCollection
A MixedCollection containing the defined Fields for the Records stored in this Store. Read-only.
Store
  isDestroyed : Boolean True
Store
  multiSort : Boolean True
Store
  multiSortInfo : Object
Object containing overall sort direction and an ordered array of sorter configs used when sorting on multiple fields
Store

Public Methods

Method Defined By

Public Events

Event Defined By