PDA

View Full Version : Select all text in text edtior



EmCy90
2 Feb 2012, 7:45 AM
I have a basic grid that uses the cellediting plugin and the editors specified for the different columns are of type textfield. What i want to do is when a editor is opened the text in it to be selected. Any ideas ?

josephkirubakaran
2 Feb 2012, 9:22 AM
You need to listen for the field focus event to select the text.


listeners:{
focus: function(e, opts){


e.selectText();
return true;


}
}

friend
2 Feb 2012, 10:22 AM
In your textfield config, you can also specify:



{
xtype: 'textfield',
selectOnFocus: true
}