REQUIRED INFORMATION

Ext version tested:
  • Touch 2.0PR3
Browser versions tested against:
  • Chrome 17
  • Safari 5.1.2
Description:
  • WebStorage proxies don't use their reader/writer instances, therefore associated data is left out when using these types of proxy.
Code:
// Product Model
Ext.define('Product', {
    fields: [
        {name: 'pid', type: 'int'},
        {name: 'name', type: 'string'}
    ],
    associations: [{
        type: 'belongsTo',
        model: 'Category'
    }]
});


// Category Model
Ext.define('Category', {
    extend: 'Ext.data.Model',
    fields: [
        {name: 'id', type: 'int'},
        {name: 'name', type: 'string'}
    ],
    proxy: {
        type: 'localstorage',
        id  : 'my-categories'
    },
    hasMany: {
        model: 'Product',
        name : 'products',
        filterProperty: 'pid',
        proxy: {
            type: 'localstorage',
            id  : 'products'
        }
    }
});


// Categories Store
Ext.define('Categories', {
    extend: 'Ext.data.Store',
    model: 'Category',
});

Code:
var c = new Categories();
c.loadData([
    {
        id: 1,
        name: 'First Category',
        products: [
            {
                pid: 1,
                name: 'First Product'
            }
        ]
    }
]);


c.sync();

Refresh browser window, then:


Code:
var c = new Categories();
c.load({success: function(records){ console.log(records); }});