Results 1 to 3 of 3

Thread: textfield focus doesn't work in control?

  1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    3
    Vote Rating
    0
      0  

    Default textfield focus doesn't work in control?

    i have some textfields in my view file,such as:

    items: [
    {
    xtype: 'textfield',
    name: 'name',
    itemId: 'txtName',
    labelCls: 'input_label',
    clearIcon: true
    },
    //other code

    when i listen the txtName focus event in my controller file,it didn't work;

    init: function() {
    this.control({
    '#txtName':
    {
    focus: this.onTxtNameFocus
    }
    })
    }

    onTxtNameFocus: function(txt, e, eOpts) {
    alert('0'); //it didn't work
    }

    can someone tell me where i was wrong? ths.

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Vote Rating
    1272
      0  

    Default

    you just specified an itemId without a parent in your selector
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Dec 2011
    Posts
    3
    Vote Rating
    0
      0  

    Default

    it works,thank you very much.

Posting Permissions

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