View Full Version : No new line possible with TextArea in EditorGrid

23 Jun 2009, 6:44 AM
Hey guys,

I read about this problem (and possible solutions) in the ext forums, but I've found no solution for me.
Using a EditorGrid with a TextArea as CellEditor does not allow me to enter new-lines. It populates the <enter>-Key to the EditorGrid and it stops editing.
Some code:

ColumnConfig config = new ColumnConfig(id,"title",200);
TextArea textArea = new TextArea();
textArea.setInEditor(true); // necessary ?
CellEditor cellEditor = new CellEditor(textArea);
cellEditor.setCompleteOnEnter(false); // explicit
ColumnModel model = ColumnModel(configs);
EditorGrid<SomeType> grid = new EditorGrid<SomeType>(store,model);

I don't have any experience with the JavaScript part of the Ext-Lib. Maybe it's possible to do some js-hacks :D


23 Jun 2009, 12:20 PM
Ok..found (a dirty hack) solution. After overriding the SelectionModel's key methods with nothing it works.
And adding a replace("\n","<br />") to the CellRenderer makes it even better :D

23 Jun 2009, 3:39 PM
I had similar issue with ContentPanel.addText(), "\n" no longer works, had to use "<br/>".