Currently I got problem with setting focus on extjs textfield. When form show, I want to set focus to First name text box and I try to use build in function focus() but stil
That works for me. In textfield or textarea add listeners config:
listeners:{
afterrender:'onRender'
}
After, in your controller write function:
onRender:function(field){
Ext.defer(()=>{
field.focus(false,100);
},1);
}
Ext.defer is wrap for setTimout(). Without Ext.defer() field.focus() doesn't work and i don't why. You cant write that function in listeners config instead of using controller's function name, but good practice is hold functions in component's controller. Good luck.