Note that there are some explanatory texts on larger screens.

plurals
  1. POExtjs - textarea enter event
    primarykey
    data
    text
    <p>I'm using textarea and I can't enter to break line.</p> <pre><code> xtype: 'textarea', name:'mt', fieldLabel: 'example', labelWidth: 100, width:100, labelAlign : 'right', maxLength: 100, value: 'example' </code></pre> <p>I'm using the code belowwith above and it's working and store data into mysql with type varchar(500..), but when I re-load it to the same form (textarea) it's not running.</p> <pre><code> listeners: { afterrender: function(){ var me = this; me.el.swallowEvent(['keypress','keydown' ]); } } </code></pre> <p>The first: How can I fix that? <br>The second: I listen enter event at (all) form with below code, but I want it not listen in my textarea (because enter to break line), is it possible and how to do that? thanks</p> <pre><code> ,listeners: { render : function() { Ext.create('Ext.util.KeyNav', this.getEl(), { "enter" : function(e){ // do form } scope: this }); } } </code></pre> <p><b>Update first solution</b><br> I using the code to re-load data from mysql to my form :) and it's working well</p> <pre><code>str_replace("\n", "\\n",$r[..]) </code></pre> <p>I try to solve second problem. My idea is check if textarea focus = true then do not run (3rd code in my question) but i know set focus is this.down('textarea').focus(true,100); but i don't know how to check has focus? <br><b>Update second solution</b><br></p> <pre><code>enableKeyEvents: true, listeners: { afterrender: function(){ var me = this; me.el.swallowEvent(['keypress','keydown' ]); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload