Results 1 to 6 of 6

Thread: Design view doesn't find my static functions

  1. #1
    Sencha User
    Join Date
    Aug 2014
    Posts
    21

    Default Design view doesn't find my static functions

    I have the following model:

    Code:
    Ext.define('MyApp.model.MyModel', {
        requires: [
            'Ext.data.field.Date'
        ],
    
        statics: {
            parseDate: function() {
                return strDate === '0001-01-01' ? null : new Date(strDate);
            }
            },
    
        convertOnSet: false,
    
        fields: [
            {
                type: 'date',
                convert: function(v, rec) {
                    return self.parseDate(v);
                }
            }
        ]
    
    });
    The preview works fine on my browser.
    Yet the architect keeps logging the following error:

    Scit_DesignView_Bug.jpg

    Until I either go mad or the architect starts lagging so much that it freezes and I have to close it. (Currently the error is shown 1500 times so it's still running fine!)

    How can I make it understand that when I write "self" I refer to well self? (!)

    Running versions:
    version: 3.2.0.73
    channel: 3.2-stable
    platform: 1.4.1.960
    cmd: 5.1.1.39
    framework: Ext JS 5.1.x


    Thanks in advance

  2. #2
    Sencha User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,488

    Default

    I don't see anywhere that you defined self.... self isn't a special keyword like in Python. The keyword is this and has many unique characteristics in JS.

    Replace self with MyApp.model.MyModel
    Aaron Conran
    @aconran

  3. #3
    Sencha User
    Join Date
    Aug 2014
    Posts
    21

    Default

    Sorry my bad I meant
    Code:
    return rec.self.parseDate();
    It's working in my browser and not in the design view.

  4. #4
    Sencha User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,488

    Default

    Yea, we don't define the whole class in the canvas.
    Aaron Conran
    @aconran

  5. #5
    Sencha User
    Join Date
    Aug 2014
    Posts
    21

    Default

    Do you **have** to send an entry to the error log EVERY SECOND!? Can I deactivate the error checking?

  6. #6
    Sencha User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,488

    Default

    Would be nice to at least show a number next to it similar to webkit's developer tools
    Aaron Conran
    @aconran

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •