-
16 Feb 2012 7:02 AM #1
4.1 b2 possible bug in Ext.data.Model
4.1 b2 possible bug in Ext.data.Model
When i added field with name "default" to model
i got errorCode:Ext.define('ExampleModel', { extend: 'Ext.data.Model', fields: [ { name: 'model_id', type: 'int' }, { name: 'default' } ], idProperty: 'model_id', proxy: { type: 'ajax', api: { create: '/catalog/attribute/create/', read: '/catalog/attribute/', update: '/catalog/attribute/update/', destroy: '/catalog/attribute/delete/' }, reader: { type: 'json', root: 'data' } } });
after trying to load model with this fieldCode:missing variable name default = fields.get("default"),ext-all-debug.js (line 46224, col 4) http://*/assets/ext-4.0.7/ext-all-debug.js/eval/seq/22 Line -19149i got errorCode:Ext.ModelMgr.getModel('ExampleModel').load(1, {callback: function() {console.log(arguments);}});
//wbrCode:TypeError: this.proxy is undefined http://*/assets/ext-4.1.0-beta-2/ext-all-debug.js Line 46224
Last edited by redraid; 16 Feb 2012 at 8:34 AM. Reason: Fixed error in field list
-
16 Feb 2012 7:42 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,624
- Vote Rating
- 435
So you did this and got the error:
I would think you would as default is a reserved word in JavaScript.Code:Ext.define('ExampleModel', { extend: 'Ext.data.Model', fields: [ { name: 'model_id', type: 'int' }, { name: 'default' } ], idProperty: 'model_id', proxy: { type: 'ajax', api: { create: '/catalog/attribute/create/', read: '/catalog/attribute/', update: '/catalog/attribute/update/', destroy: '/catalog/attribute/delete/' }, reader: { type: 'json', root: 'data' } } });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 Feb 2012 8:31 AM #3
Yes, i miss {name: 'default'} field when copy-paste and clean code, with 4.0.7 no errors
-
16 Feb 2012 1:09 PM #4
This issue is already fixed for b3, thanks for the report.
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
17 Feb 2012 1:23 AM #5
I should specify that in the 4.1 b2 names of the js control structures can not be field names.
//wbr


Reply With Quote