简体   繁体   English

sencha触摸的文本字段中的模糊和聚焦方法不起作用

[英]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 任何人都可以告诉我如何在sencha touch中为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 : 然后可以使用ComponentQuery选择它:

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

txtName.focus();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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