简体   繁体   中英

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

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

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();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM