【发布时间】:2015-11-07 14:45:48
【问题描述】:
谁能告诉我如何在 sencha touch for ios 中实现焦点和模糊方法
我试过这种方法
Ext.getComponent('txtName').focus();
谢谢
【问题讨论】:
标签: javascript sencha-touch sencha-architect sencha-touch-2.1
谁能告诉我如何在 sencha touch for ios 中实现焦点和模糊方法
我试过这种方法
Ext.getComponent('txtName').focus();
谢谢
【问题讨论】:
标签: javascript sencha-touch sencha-architect sencha-touch-2.1
如果您的文本字段如下所示:
{
xtype: 'textfield',
itemId: 'txtName' // Best practice is to use itemId instead of id
}
然后您可以使用ComponentQuery 选择它:
var txtName = Ext.ComponentQuery.query('#txtName')[0];
txtName.focus();
【讨论】: