Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-2855 in a recent build.
  1. #1
    Ext Premium User
    Join Date
    Mar 2007
    Posts
    89
    Vote Rating
    1
    Luc is on a distinguished road

      0  

    Default [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

    Code:
    fieldConfig.type.type == 'date'
    This should be:

    Code:
    fieldConfig.type == 'date'

  2. #2
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    20
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    Will verify, thank you for the report.

    Sencha Inc

    Jamie Avins

    @jamieavins

  3. #3
    Sencha User
    Join Date
    Mar 2007
    Location
    Haarlem, Netherlands
    Posts
    1,243
    Vote Rating
    10
    TommyMaintz will become famous soon enough TommyMaintz will become famous soon enough

      0  

    Default


    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;
        }
    });

  4. #4
    Sencha User
    Join Date
    Apr 2012
    Posts
    9
    Vote Rating
    2
    pksiv is on a distinguished road

      0  

    Default


    Quote Originally Posted by TommyMaintz View Post
    Hi Luc,

    Thanks for the report. Could you try the following override and see if it fixes the issues you ran into?
    .. code removed
    Any info on when this fix will be released ? I got the impression from the note at the top that this will be in 2.0.2 but don't see any indication when this will be released.