-
27 Oct 2008 2:02 AM #1
Change behaviour of enter and shift+enter in TextArea in EditorGridPanel
Change behaviour of enter and shift+enter in TextArea in EditorGridPanel
Hi all,
I've been trying to find some way to change the way ENTER and SHIFT+ENTER behaves
in a TextArea in a EditorGridPanel.
To put it short. Normally the TextArea in a EditorGridPanel uses ENTER to add a new line in
the textarea and SHIFT+ENTER ends the editor mode.
How to reverse this?
If I would like SHIFT+ENTER to do a new line and ENTER to end editor mode.
Eg. work exactly the oppisite way.
I have been trying with some event, overrides, etc without any luck.
Is this easy or hard to do?
Best regards // J
-
27 Oct 2008 2:38 AM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 43
Try defining you column editor as:
Code:editor: new fm.TextArea({ fireKey : function(e){ if(e.isSpecialKey() && (this.enterIsSpecial || (e.getKey() != e.ENTER || !e.hasModifier()))){ this.fireEvent("specialkey", this, e); } } })
-
27 Oct 2008 3:05 AM #3
Thanks! Great!

It works as far as making ENTER leave editmode and not to a newline in the textarea.
But how to get SHIFT+ENTER to do what ENTER used to do: a newline in the textarea?
Any ideas?
Regards // J


Reply With Quote