I have a window containing a form (formPanel). Users can display this window by clicking a button in ExtJS. I would like the user to click the button to display the window, the special field inside the form contained in the window will focus (I mean, the cursor must go to this field so that the user can insert data without having to first click on the field) .
I tried some solutions, but could not get them to work. Any clues?
Here is what I tried using some examples that I found ... but it does not work as expected. This function () is called by the ExtJS button in my interface:
function openCardForm(IDUser){
Ext.getCmp('assignFormCARDNUMBER').reset();
formAssignCard.getForm().load({
url: 'gen/jsonUser.php',
params:{IDUser:IDUser},
waitMsg: 'Loading...'
});
Ext.getCmp('assignFormCARDNUMBER').on("render",function(){
Ext.getCmp('assignFormCARDNUMBER').focus(true,10);
});
win.show();
}
source
share