-
textfield focus doesn't work in control?
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.
-
Sencha - Senior Forum Manager
you just specified an itemId without a parent in your selector
-
it works,thank you very much.
Sencha is used by over two million developers. Join the community, wherever you’d like that community to be
or Join Us