【问题标题】:Blur and focus method is not working in textfield for sencha touch模糊和焦点方法在 sencha touch 的文本字段中不起作用
【发布时间】:2015-11-07 14:45:48
【问题描述】:

谁能告诉我如何在 sencha touch for ios 中实现焦点和模糊方法

我试过这种方法

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

谢谢

【问题讨论】:

    标签: javascript sencha-touch sencha-architect sencha-touch-2.1


    【解决方案1】:

    如果您的文本字段如下所示:

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

    然后您可以使用ComponentQuery 选择它:

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

    【讨论】:

      猜你喜欢
      • 2016-01-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-22
      相关资源
      最近更新 更多