Thank you for reporting this bug. We will make it our priority to review this report.
-
Sencha User
[FIXED]LocalStorage Proxy: rawData is null
I'm using the fix:
Code:
Ext.data.Model.override({
getProxy: function(){
return this.self.proxy;
}
});
Code:
Ext.regModel('User', {
fields: [
{name: 'firstName', type: 'string'},
{name: 'lastName', type: 'string'},
{name: 'age', type: 'int'},
{name: 'eyeColor', type: 'string'}
],
proxy: {
type: 'localstorage',
id: 'users'
}
});
new Ext.data.Store({
model: 'User',
storeId: 'UserStore',
autoLoad: true
});
var grid = new Ext.grid.GridPanel({
title: '',
store: 'UserStore',
headers: [
{ text: 'First Name', dataIndex: 'firstName'},
{ text: 'Last Name', dataIndex: 'lastName'}
]
});
var win = new Ext.Window({
title: 'Webtool List',
width: 400,
height: 300,
layout: 'fit',
items: [grid],
buttons: [
{
text: 'Add Random',
handler: function () {
var user = Ext.ModelMgr.create({
firstName: 'Bryan',
lastName: 'Zarzuela',
age: 29,
eyeColor: 'Black'
}, 'User');
user.save();
}
}
]
});
win.show();
When I click save for the first time, no error. However, when you reload the page and the store tries to load the data from localStorage, this comes up:
rawData is null
http://ext4test.teleserv.mac:8080/ext/ext-all-debug.js
Line 28519
The previous call from getRecord has a parameter called id with a value of NaN
-
Sencha User
Screen shot 2011-02-24 at 4.50.20 PM.jpg
Here's the output of console.dir(window.localStorage);
Disregard the users1, I tested renaming the store's ID while debugging.
-
I believe this is already resolved. Can you try with the next preview release when it comes out?
Thanks.
Twitter - @evantrimboli
Former Sencha framework engineer, available for consulting.
As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.