-
16 Dec 2011 6:29 AM #1
TypeError on store.sync()
TypeError on store.sync()
Hi,
I'm getting an error calling store sync() after removing or adding a record. Here's my code:
remove: function() {
var form = Ext.getCmp('createeditgathr');
var record = form.getRecord();
var store = this.getGathrsStore();
store.remove(record);
store.sync();
this.index({ type: 'slide', direction: 'left' });
},
The model instance is correct and remove() completes without error. I get the error below on the store.sync() call. Any ideas?
- [COLOR=red !important]Uncaught TypeError: Cannot call method 'destroy' of undefined[/COLOR]
- [COLOR=red !important]Ext.define.runOperation[/COLOR]sencha-touch-all-debug-w-comments.js:30616
- [COLOR=red !important]Ext.define.runNextOperation[/COLOR]sencha-touch-all-debug-w-comments.js:30569
- [COLOR=red !important]Ext.define.start[/COLOR]sencha-touch-all-debug-w-comments.js:30561
- [COLOR=red !important]Ext.define.batch[/COLOR]sencha-touch-all-debug-w-comments.js:32152
- [COLOR=red !important]Ext.define.sync[/COLOR]sencha-touch-all-debug-w-comments.js:36164
- [COLOR=red !important]Base.implement.callParent[/COLOR]sencha-touch-all-debug-w-comments.js:4488
- [COLOR=red !important]Ext.define.sync[/COLOR]sencha-touch-all-debug-w-comments.js:39076
- [COLOR=red !important]Ext.define.remove[/COLOR]Gathr.js:166
- [COLOR=red !important]control.#gathrFormDeleteButton.tap[/COLOR]Gathr.js:69
- [COLOR=red !important]Uncaught TypeError: Cannot call method 'destroy' of undefined[/COLOR]
-
16 Dec 2011 6:55 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,117
- Vote Rating
- 453
Can I get a test case? Need some more code to be able to reproduce and look at what the problem is.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
16 Dec 2011 8:01 AM #3
Here's the model:
Ext.define('TestApp.model.Gathr', {
extend: 'Ext.data.Model',
fields: [
{name: 'id', type: 'int'},
{name: 'server_id', type: 'int'},
{name: 'owner_server_id', type: 'int'},
{name: 'name', type: 'string'},
{name: 'description', type: 'string'},
{name: 'category_id', type: 'int'},
{name: 'private', type: 'boolean'},
],
proxy: {
type: 'localstorage',
id: 'gathrproxy'
}
});
Here's the store:
Ext.define('TestApp.store.Gathrs', {
extend : 'Ext.data.Store',
requires: 'TestApp.model.Gathr',
model : 'TestApp.model.Gathr',
storeId : 'gathrStore',
autoLoad: true,
});
The model instance returned from the form is valid and contains data. Let me know if you need anything else.
Thanks.
-
5 Jan 2012 7:33 AM #4Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Haarlem, Netherlands
- Posts
- 1,235
- Vote Rating
- 5
This is a duplicate of TOUCH-1019 and will be fixed as part of that bug. This will likely be fixed in the next Touch 2.0 release.
This duplicates another bug already reported in our system:
TOUCH-1280


Reply With Quote
