I have a requirement in my app to dynamically focus on the textfield when the page loads. I have tried some workarounds as mentioned below


1.)

Ext.getCmp('idTextFocus').focus();


I have also tried to focus in a timeout function


setTimeout(function(){ Ext.getCmp('idTextFocus').focus();},1000);


2.) Created an input text inside html


{

html:'<input type="text" id="idTextFocus1" />'
}


In painted function i have written


document.getElementById('idTextFocus1').focus();


I have also tried to give a time out function


setTimeout(function(){ document.getElementById('idTextFocus1').focus();},1000);


I am using Sencha Touch 2.2 and Phonegap, i have also tried with the latest sencha touch version but could'nt get it working.


Can i write some Phonegap plugin to forcefully open the keyboard or is there any piece of code to fix this particular Sencha Touch issue.


Can someone please help me with this issue?