PDA

View Full Version : select first field in formpanel?



Radziu
20 Feb 2009, 12:02 AM
how to set focus on the first field in every form?

20 Feb 2009, 9:04 AM
someField.el.focus()?

You can only focus one element in the browser. hell, this is the same for any UI. Only one item can be focused.

Hermann
23 Apr 2009, 5:23 AM
I used this simple code:



new Ext.FormPanel({
.....
items: [{
xtype: 'textfield'
value : 'Something goes here',
listeners : {
"afterrender" : function(){
var field = this.getEl();
setTimeout(function(){field.focus();}, 1000 );
}
}
}]
})