Results 1 to 3 of 3

Thread: Change behaviour of enter and shift+enter in TextArea in EditorGridPanel

  1. #1
    Ext User
    Join Date
    Aug 2008
    Posts
    3
    Vote Rating
    0
      0  

    Default 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

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    118
      0  

    Default

    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);
    		}
    	}
    })

  3. #3
    Ext User
    Join Date
    Aug 2008
    Posts
    3
    Vote Rating
    0
      0  

    Default

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •