-
2 May 2012 6:40 AM #1
[4.1.0] Ext.data.Types.AUTO is missing the convert method
[4.1.0] Ext.data.Types.AUTO is missing the convert method
The documentation here
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.Types
states that types must have 3 properties, convert, sortType and type. In 4.1.0 the AUTO type has no convert method as can be seen by looking at the source
http://docs.sencha.com/ext-js/4-1/so...-property-AUTO
I created my own property grid that relied on AUTO having a convert method. I can work around the problem but I don't thing the library should remove code that is supposed to exist.
-
7 May 2012 9:04 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,624
- Vote Rating
- 434
convert is an option configuration. I don't see where it says it requires them, I see it says devs may add them.
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.
-
7 May 2012 9:23 AM #3
Field type AUTO do not have convert method but Field constructor expect it
Field type AUTO do not have convert method but Field constructor expect it
Field type AUTO do not have convert method but Field's constructor expect it.
Error is: this.type.convert is not a function Line 37449 on ext-all-debug.js Ext JS 4.1 Release
Extract from: http://docs.sencha.com/ext-js/4-1/so...-property-AUTO
Code:Ext.define('Ext.data.Types', { singleton: true, requires: ['Ext.data.SortTypes'] }, function() { var st = Ext.data.SortTypes; Ext.apply(Ext.data.Types, { /** * @property {RegExp} stripRe * A regular expression for stripping non-numeric characters from a numeric value. Defaults to <tt>/[\$,%]/g</tt>. * This should be overridden for localization. */ stripRe: /[\$,%]/g, /** * @property {Object} AUTO * This data type means that no conversion is applied to the raw data before it is placed into a Record. */ AUTO: { sortType: st.none, type: 'auto' }, ... Ext.define('Ext.data.Field', { requires: ['Ext.data.Types', 'Ext.data.SortTypes'], alias: 'data.field', constructor : function(config) { if (Ext.isString(config)) { config = {name: config}; } Ext.apply(this, config); var types = Ext.data.Types, st = this.sortType; if (this.type) { if (Ext.isString(this.type)) { this.type = types[this.type.toUpperCase()] || types.AUTO; } } else { this.type = types.AUTO; } if (Ext.isString(st)) { this.sortType = Ext.data.SortTypes[st]; } else if(Ext.isEmpty(st)) { this.sortType = this.type.sortType; } if (!config.hasOwnProperty('convert')) { this.convert = this.type.convert; } else if (!this.convert && !config.hasOwnProperty('defaultValue')) { this.defaultValue = this.type.convert(this.defaultValue); } },
-
7 May 2012 10:45 AM #4
Line:
this.defaultValue = this.type.convert(this.defaultValue);At: http://docs.sencha.com/ext-js/4-1/so...ld-cfg-convert
Can be called against AUTO, so ExtJS 4.1 Release code believe all Type should have convert, including AUTO.
-
7 May 2012 1:32 PM #5Sencha - Community Support Team
- Join Date
- Nov 2007
- Location
- Helsingborg, Sweden
- Posts
- 2,455
- Vote Rating
- 50
This is likely fixed for 4.1.1, proposed fix here: http://www.sencha.com/forum/showthre...del-regression
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote