-
27 Apr 2012 12:22 PM #1
[2.0.0] error in Writer.js: fieldConfig.type.type == 'date' (2x)
[2.0.0] error in Writer.js: fieldConfig.type.type == 'date' (2x)
Sencha Touch version: 2.0.0
In 'Ext.data.writer.Writer' in method getRecordData, there are 2 occurences of
This should be:Code:fieldConfig.type.type == 'date'
Code:fieldConfig.type == 'date'
-
27 Apr 2012 12:24 PM #2Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,653
- Vote Rating
- 14
Will verify, thank you for the report.
-
7 May 2012 10:02 AM #3Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Haarlem, Netherlands
- Posts
- 1,235
- Vote Rating
- 4
Hi Luc,
Thanks for the report. Could you try the following override and see if it fixes the issues you ran into?
Code:Ext.define('Ext.data.WriterFix', { override: 'Ext.data.writer.Writer', getRecordData: function(record) { var isPhantom = record.phantom === true, writeAll = this.getWriteAllFields() || isPhantom, nameProperty = this.getNameProperty(), fields = record.getFields(), data = {}, changes, name, field, key, value; if (writeAll) { fields.each(function(field) { if (field.getPersist()) { name = field.config[nameProperty] || field.getName(); value = record.get(field.getName()); if (field.getType().type == 'date') { value = this.writeDate(field, value); } data[name] = value; } }, this); } else { // Only write the changes changes = record.getChanges(); for (key in changes) { if (changes.hasOwnProperty(key)) { field = fields.get(key); if (field.getPersist()) { name = field.config[nameProperty] || field.getName(); value = changes[key]; if (field.getType().type == 'date') { value = this.writeDate(field, value); } data[name] = value; } } } if (!isPhantom) { // always include the id for non phantoms data[record.getIdProperty()] = record.getId(); } } return data; } });
-
11 May 2012 6:39 AM #4
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-2855
in
Sprint 22 (2.0.2).


Reply With Quote

