-
20 Nov 2011 8:19 PM #1
localstorage: Uncaught TypeError: Cannot call method 'create' of undefined
localstorage: Uncaught TypeError: Cannot call method 'create' of undefined
sencha touch 2 PR2
google chrome
source code:
the source code form Sencha Touch Document.Code:Ext.setup({ icon: 'icon.png', tabletStartupScreen: 'tablet_startup.png', phoneStartupScreen: 'phone_startup.png', glossOnIcon: false, onReady: function(){ Ext.define('Search', { extend: 'Ext.data.Model', fields: ['id', 'query'] }); //our Store automatically picks up the LocalStorageProxy defined on the Search model var store = Ext.create('Ext.data.Store', { model: "Search", proxy: { type: 'localstorage', id : 'test-Searches' } }); //loads any existing Search data from localStorage store.load(); // //now add some Searches store.add({query: 'Sencha Touch'}); store.add({query: 'Ext JS'}); // // //finally, save our Search data to localStorage store.sync(); } });
error: Uncaught TypeError: Cannot call method 'create' of undefined
-
21 Nov 2011 1:29 AM #2
Hi,
I've the same problem, anyone could help us?
-
21 Nov 2011 11:50 PM #3
There are some issues with the data package in the current PR, including this bug. These issues will be fixed before the GA.
Sencha Inc.
Robert Dougan - @rdougan
Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.
-
22 Nov 2011 12:38 PM #4
I had the same error. This is because the proxy-property in the Ext.data.Batch is never set. As a workaround you can add this to the constructor:
Code:if (config.hasOwnProperty) { this.proxy = config.proxy; }
-
23 Nov 2011 7:06 AM #5
-
23 Nov 2011 11:28 PM #6
-
29 Nov 2011 12:31 AM #7
Hi,
I would be possible to have more code because I can't understand how to use this indication?
Thank you.
-
29 Nov 2011 1:10 AM #8
You have to change the contructor of Ext.data.Batch in your sencha-js file. I did it for the sencha-touch-all-debug.js. You will find the definition of this class at line 21456. There you have to change the constructor like this:
Hopefully this will be fixed with the next update. Sencha announced several updates to the data package.Code:constructor: function(config) { var me = this; // aflx if (config.hasOwnProperty) { this.proxy = config.proxy; } me.mixins.observable.constructor.call(me, config); me.operations = []; },
-
29 Nov 2011 1:37 AM #9
That's work, thank you...
-
5 Jan 2012 12:36 AM #10
Is this still a problem in PR 3, also affects sessionstorage, that's right ?
I think it's, but with the fix of aflx it work's


Reply With Quote