Results 1 to 2 of 2

Thread: how to get component object from el: HTMLElement id

  1. #1
    Sencha Premium Member
    Join Date
    Jun 2012
    Posts
    41
    Vote Rating
    -1
      0  

    Default Unanswered: how to get component object from el: HTMLElement id

    var textField2 = Ext.create('Ext.form.field.Text', {
    fieldLabel : 'LastName',
    name : 'last'
    // id:'lastid'
    });

    el: HTMLInputElement
    <input id="
    textfield-1040-inputEl" type="text" size="1" name="first" style="width:100%>

  2. #2
    Sencha User
    Join Date
    Jan 2012
    Posts
    1,376
    Answers
    347
    Vote Rating
    114
      0  

    Default

    Try this:
    Code:
    var cmp = Ext.getCmp( el.id.replace(/-[a-z]+$/i, '') );

Posting Permissions

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