Blur and focus method is not working in textfield for sencha touch

402 views Asked by At

Can any body tell how to implement focus and blur method in sencha touch for ios

I have tried this way

Ext.getComponent('txtName').focus();

Thanks

1

There are 1 answers

0
Tarabass On

If your textfield looks like this:

{
    xtype: 'textfield',
    itemId: 'txtName' // Best practice is to use itemId instead of id
}

You can select it then with ComponentQuery:

var txtName = Ext.ComponentQuery.query('#txtName')[0];

txtName.focus();