Results 1 to 5 of 5

Thread: Textfield, markInvalid issue

  1. #1
    Sencha User mschwartz's Avatar
    Join Date
    Nov 2008
    Location
    San Diego, Peoples' Republic of California
    Posts
    2,061

    Default Textfield, markInvalid issue

    See the code below. It's marking the field invalid on keydown, but it's removing the invalid indicator on key up.


    Code:
                {
                    xtype: 'textfield',
                    id: 'tf',
                    fieldLabel: 'label',
                    anchor: '-41',
                    msgTarget: 'side',
                    enableKeyEvents: true,
                    listeners: {
                        keydown: function() {
                            Ext.getCmp('tf').markInvalid('invalid!');
                        }
                    }
                }

  2. #2
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    confirmed.

    A quick copy and paste test case:
    Code:
    new Ext.Window({
        width : 300,
        height : 100,
        items  :  {
                    xtype: 'textfield',
                    id: 'tf',
                    fieldLabel: 'label',
                    anchor: '-41',
                    msgTarget: 'side',
                    enableKeyEvents: true,
                    listeners: {
                        keydown: function() {
                            Ext.getCmp('tf').markInvalid('invalid!');
                        }
                    }
                }
    
    
    
    }).show();

  3. #3
    Sencha User mschwartz's Avatar
    Join Date
    Nov 2008
    Location
    San Diego, Peoples' Republic of California
    Posts
    2,061

    Default

    This could be marked as a bug, or it could be the expected behaviour. It seems to me the behaviour isn't right tho...

  4. #4
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    Good question. It seems to be an issue with the validation calling clearInvalid

  5. #5
    Sencha User mschwartz's Avatar
    Join Date
    Nov 2008
    Location
    San Diego, Peoples' Republic of California
    Posts
    2,061

    Default

    Quote Originally Posted by [email protected] View Post
    Good question. It seems to be an issue with the validation calling clearInvalid
    Right, but the defaults seem to imply no validation will occur - clearInvalid() and markInvalid() should not be touched by the library, IMO, unless you set allowBlank: false, validator, vtype, and/or any other things that imply validation.

Posting Permissions

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