Results 1 to 2 of 2

Thread: Highlight form TextField in 4.0

  1. #1
    Sencha User
    Join Date
    Oct 2007
    Posts
    40
    Answers
    1
    Vote Rating
    0
      0  

    Default Answered: Highlight form TextField in 4.0

    I am trying to highlight the textfield when the focus event is fired. In Ext JS 3.x the following worked:

    Code:
         
    ccTF = new Ext.form.TextField({
                            fieldLabel: 'CC',
                            id: 'cc',
                            name: 'cc',
                            anchor: '100%',
                            onFocus: function(){
                                this.el.setStyle('background', 'lightblue');
                            },
                            onBlur: function(){
                                this.el.setStyle('background','#FFFFFF');
                            }
                        });
    In 4.x it is changing the background of the label. I would greatly appreciate any help.

  2. The fix for 4.x is the following:

    Code:
    ccTF = new Ext.form.TextField({                         fieldLabel: 'CC',                         id: 'cc',                         name: 'cc',                         anchor: '100%',                         onFocus: function(){                             this.inputEl.setStyle('background', 'lightblue');                         },                         onBlur: function(){                             this.inputEl.setStyle('background','#FFFFFF');                         }                     });

  3. #2
    Sencha User
    Join Date
    Oct 2007
    Posts
    40
    Answers
    1
    Vote Rating
    0
      0  

    Red face Post solved

    The fix for 4.x is the following:

    Code:
    ccTF = new Ext.form.TextField({                         fieldLabel: 'CC',                         id: 'cc',                         name: 'cc',                         anchor: '100%',                         onFocus: function(){                             this.inputEl.setStyle('background', 'lightblue');                         },                         onBlur: function(){                             this.inputEl.setStyle('background','#FFFFFF');                         }                     });

Posting Permissions

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