1. #11
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    16
    jack.slocum will become famous soon enough

      0  

    Default


    Thanks for the detailed explanation. Here's an idea: What about changing onFocus to this:

    Code:
    onFocus : function(){
            if(!Ext.isOpera){ // don't touch in Opera
                this.el.addClass(this.focusClass);
            }
            if(!this.hasFocus){
                this.hasFocus = true;
                this.startValue = this.getValue();
                this.fireEvent("focus", this);
            }
        }
    Does that solve the issue?
    Jack Slocum
    Ext JS Founder
    Original author of Ext JS 1, 2 & 3.
    Twitter: @jackslocum
    jack@extjs.com

  2. #12
    Sencha - Community Support Team mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236
    Vote Rating
    5
    mystix will become famous soon enough

      0  

    Default


    yep it does

    once again, elegant!

    [edit]
    just in case anyone's monitoring this thread,
    here's the complete temp override to fix DateField's change event firing
    Code:
    Ext.override(Ext.form.Field, {
      onFocus : function() {
        if (!Ext.isOpera) { // don't touch in Opera
          this.el.addClass(this.focusClass);
        }
        if (!this.hasFocus) {
          this.hasFocus = true;
          this.startValue = this.getValue();
          this.fireEvent("focus", this);
        }
      },
        
      onBlur : function() {
        this.beforeBlur();
        this.el.removeClass(this.focusClass);
        this.hasFocus = false;
        if (this.validationEvent !== false && this.validateOnBlur && this.validationEvent != "blur") {
          this.validate();
        }
        var v = this.getValue();
        if (String(v) !== String(this.startValue)) {
          this.fireEvent('change', this, v, this.startValue);
        }
        this.fireEvent("blur", this);
      }
    });

  3. #13
    Ext User
    Join Date
    Aug 2007
    Posts
    14
    Vote Rating
    0
    funseason is on a distinguished road

      0  

  4. #14
    Ext User
    Join Date
    Oct 2007
    Posts
    6
    Vote Rating
    0
    toriaa is on a distinguished road

      0  

    Default


    Quote Originally Posted by mystix View Post
    [edit]
    just in case anyone's monitoring this thread,
    here's the complete temp override to fix DateField's change event firing
    I'm using this fix to execute on 'change' for a ComboBox. It works (thank you!!!) except in the case where I backspace the current selection.

    I've got allowBlank:true and forceSelection:true. Backspacing the selection so that the field is empty is an acceptable value (because allowBlank:true), but it does not fire the 'change' event.

    Any ideas on how to fix this?

  5. #15
    Sencha - Community Support Team mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236
    Vote Rating
    5
    mystix will become famous soon enough

      0  

    Default


    Quote Originally Posted by toriaa View Post
    I'm using this fix to execute on 'change' for a ComboBox. It works (thank you!!!) except in the case where I backspace the current selection.

    I've got allowBlank:true and forceSelection:true. Backspacing the selection so that the field is empty is an acceptable value (because allowBlank:true), but it does not fire the 'change' event.

    Any ideas on how to fix this?
    IIRC, forceSelection and allowBlank are mutually exclusive.

    it doesn't make sense to say "it's ok if it's blank, but you have to make at least 1 selection".

    you'll also notice that once forceSelection is true, your field will never be blank once a selection has been made. HTH.

  6. #16
    Sencha User
    Join Date
    May 2008
    Posts
    262
    Vote Rating
    -4
    mnask79 is infamous around these parts

      0  

    Default


    why Ext.form.DateField at ext 1.1 dose not work very well at ff3

    the calancder window width very big and its make troubles

    how to fix it

    regards

  7. #17
    Ext User
    Join Date
    May 2010
    Posts
    1
    Vote Rating
    0
    tlbollwitt is on a distinguished road

      0  

    Default


    Quote Originally Posted by mystix View Post
    yep it does

    once again, elegant!

    [edit]
    just in case anyone's monitoring this thread,
    here's the complete temp override to fix DateField's change event firing
    Code:
    Ext.override(Ext.form.Field, {
      onFocus : function() {
        if (!Ext.isOpera) { // don't touch in Opera
          this.el.addClass(this.focusClass);
        }
        if (!this.hasFocus) {
          this.hasFocus = true;
          this.startValue = this.getValue();
          this.fireEvent("focus", this);
        }
      },
        
      onBlur : function() {
        this.beforeBlur();
        this.el.removeClass(this.focusClass);
        this.hasFocus = false;
        if (this.validationEvent !== false && this.validateOnBlur && this.validationEvent != "blur") {
          this.validate();
        }
        var v = this.getValue();
        if (String(v) !== String(this.startValue)) {
          this.fireEvent('change', this, v, this.startValue);
        }
        this.fireEvent("blur", this);
      }
    });
    I ran into the same issue with the ComboBox not firing the onChange event when a user manually enters text in the field (using GWT-EXT version 2.0.6). Here is a post of the tweak I made to the above code to resolve it.