View Full Version : Objects not removed from localStore (0.97)

21 Oct 2010, 5:25 AM
Hi everyone!

First of all; I'm new to Sencha Touch so I might not know everything yet.

I'm experimenting with localStore and am already able to store something in it. I use the developer tools of Chrome for debugging and if I look into Storage/Local Files I see the objects are stored as it should.

Ext.regModel('Assignment', {
fields: [
{name:'name', type:'string'}

var store = new Ext.data.Store({
proxy: new Ext.data.LocalStorageProxy({
id: 'test-assignment'
model: 'Assignment'

onReady: function() {
store.add({name: 'test1' });
store.add({name: 'test2' });
//some more code

But now I'm trying to remove something from it:


When I look again at Storage/Local Files, I see that nothing's changed.

I don't think this issue (http://www.sencha.com/forum/showthread.php?110439-FIXED-339-LocalStore-Proxy-Record-Remove-Issue&highlight=destroy+localstorage) applies to me nor does this one (http://www.sencha.com/forum/showthread.php?108851-WebStorageProxy-always-removes-first-record).

3 Nov 2010, 11:53 AM
i'm having the same problem in 0.98.

after remove() the data is really removed from the store.data, but after sync() nothing happens to the localstorage data!

13 Apr 2011, 7:47 AM
Hey guys,

See chummy's post here:

The trick is to add an id field to your regModel:

// Set up local user state model template
User.template = Ext.regModel('User', {
fields: [
'id', // PROTECTED DONT TOUCH (stupid problem w/ sencha's LocalStore model)

// User identity

// Personal info

// Proxies
User.remoteProxy = new Ext.data.AjaxProxy({
model: 'User',
url: User.proxyURL,
reader: {
type: 'json'
type: 'ajax',
actionMethods: {
read: 'POST'
id: 'user_remote'
User.localProxy = new Ext.data.LocalStorageProxy({
model: 'User',
type: 'localstorage',
id: 'user_local'