PDA

View Full Version : RowEditing with a textarea - how can the user enter a newline?



Wedgie
13 Dec 2011, 10:46 PM
The RowEditor grid plugin captures the enter key as part of its processing, but I want my user to be able to edit the text in a "textarea" field. When they press "enter" to enter a newline the RowEditor thinks they want to perform an update.

How I can I configure RowEditor so that a textarea will work correctly?

Wedgie
14 Dec 2011, 1:41 AM
Looking at the source code for Ext.grid.RowEditor in version 4.0.7 it looks like this behavior is unfortunately hard coded.

repix
4 Aug 2012, 1:51 AM
You can add the following to your textarea field:



listeners: {
afterrender: function() {
this.inputEl.swallowEvent([
'keypress',
'keydown'
]);
}
}


This way any key press event inside the textarea will not bubble up.