I am unable to make autofocus on the sencha touch textfield. I have search icon, when I tap on that icon a textfield will appear Now as soon as it is shown I have to autofocus to that textfield and open the keyboard. Tried setting listeners to main layout as below
listeners : {
show:function(){
Ext.ComponentQuery.query('searchlist #searchAreaOverlay')[0].element.down('input').dom.focus();
setTimeout(function(){Keyboard.hide();Keyboard.show();},500);
}
},
Also tried setting painted listener function of textfield as below
{
xtype : 'textfield',
itemId : 'searchAreaOverlay',
id : 'searchAreaOverlay',
layout : 'fit',
placeHolder:'Search',
inputCls:'searchfiledInputCls',
listeners : {
painted: function(){
Ext.ComponentQuery.query('searchlist #searchAreaOverlay')[0].element.down('input').dom.focus();
setTimeout(Keyboard.show(),100);
},
}
}
Nothing is working.