Results 1 to 2 of 2

Thread: field.blur() don't seem to work with date-, numberfields and comboboxes

  1. #1
    Ext JS Premium Member
    Join Date
    Jan 2011
    Posts
    16
    Vote Rating
    0
      0  

    Default field.blur() don't seem to work with date-, numberfields and comboboxes

    Problem being solved: lose fields focus.
    First logical solution: field.blur(), where field is the element that has focus
    Problem appeared: field.blur() works only if field is textfield
    Ext version: 4.0.1

    Tried it with date-, numberfields and comboboxes.

    Is this bug or something that I have done wrong?

    Or is there any other way to lose field focus?

    Many thanks in advance!

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,382
    Answers
    3997
    Vote Rating
    1535
      0  

    Default

    I don't have 4.0.1, the earliest I have is 4.0.2a and this works:

    Code:
    var form = Ext.create('Ext.form.Panel', {
        renderTo    : Ext.getBody(),
        width       : 400,
        height      : 400,
        title       : 'Test',
        items       : [
            {
                xtype      : 'textfield',
                fieldLabel : 'Text'
            },
            {
                xtype      : 'datefield',
                fieldLabel : 'Date'
            }
        ],
        dockedItems : [
            {
                xtype : 'toolbar',
                dock  : 'bottom',
                items : [
                    {
                        text    : 'Blur Text',
                        handler : function() {
                            var text = form.down('textfield');
    
                            text.blur();
                        }
                    },
                    {
                        text    : 'Blur Date',
                        handler : function() {
                            var date = form.down('datefield');
    
                            date.blur();
                        }
                    }
                ]
            }
        ]
    });
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

Posting Permissions

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