Why does 'on change' fire when record view is loaded?

I must be missing something...

Why do on change events fire when the record view is loaded before that field is indeed changed?

How can I stop the execution of an on change until the field is actually changed?

thanks,
Francesca
Parents
  • I use onchange, in events like this...
    initialize: function (options) {       this._super('initialize', [options]);
            this.events['change input[name=status]'] = 'changedStatus';
        },
        changedStatus: function() {
                console.log("Status Changed new Value is : "+this.model.get('status'));
        },


    This works perfect only fires when value is changed not fire on load of page.

    Regards,
    Usman
Reply
  • I use onchange, in events like this...
    initialize: function (options) {       this._super('initialize', [options]);
            this.events['change input[name=status]'] = 'changedStatus';
        },
        changedStatus: function() {
                console.log("Status Changed new Value is : "+this.model.get('status'));
        },


    This works perfect only fires when value is changed not fire on load of page.

    Regards,
    Usman
Children
No Data