PDA

View Full Version : how to get component object from el: HTMLElement id



Periyasamy A
12 Oct 2012, 6:07 AM
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%>

vietits
12 Oct 2012, 7:48 PM
Try this:


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