Extjs-textarea输入事件

Extjs-textarea输入事件,extjs,extjs4,textarea,Extjs,Extjs4,Textarea,我正在使用textarea,无法进入以断开线 xtype: 'textarea', name:'mt', fieldLabel: 'example', labelWidth: 100, width:100, labelAlign : 'right', maxLength: 100, value: 'example' 我正在使用上面下面的代码,它正在工作并使用varch

我正在使用textarea,无法进入以断开线

        xtype: 'textarea',
        name:'mt',
        fieldLabel: 'example',
        labelWidth: 100,
        width:100,
        labelAlign : 'right',
        maxLength: 100,
        value: 'example'
我正在使用上面下面的代码,它正在工作并使用varchar(500..)类型将数据存储到mysql中,但当我将其重新加载到同一表单(textarea)时,它不会运行

             listeners: { 
                afterrender: function(){
                    var me = this;
                     me.el.swallowEvent(['keypress','keydown'    ]); 
                }
            }
第一个问题:我怎样才能解决这个问题?
第二个:我用下面的代码在(所有)表单中监听enter事件,但我不想让它在我的文本区域中监听(因为enter可以换行),有可能吗?怎么做?谢谢

 ,listeners: {
    render : function() {
        Ext.create('Ext.util.KeyNav', this.getEl(), {
            "enter" : function(e){  
                // do form
            }
            scope: this       
        });
    }
  }
更新第一个解决方案
我使用代码将数据从mysql重新加载到我的表单:),它运行良好

str_replace("\n", "\\n",$r[..])

我试图解决第二个问题。我的想法是检查textarea focus=true,然后不运行(我问题中的第三个代码),但我知道set focus是这样的。down('textarea')。focus(true,100);但我不知道如何检查是否有焦点?
更新第二个解决方案


签出启用键事件

true以启用HTML输入字段的键事件代理。 默认为:false


签出启用键事件

true以启用HTML输入字段的键事件代理。 默认为:false


i使用me.el.event(['keypress','keydown']);(我试图解决第二个问题。我的想法是检查textarea focus=true,然后不运行(我问题中的第三个代码),但我知道设置焦点是这样的。down('textarea')。focus(true,100);但我不知道如何检查是否有焦点?我使用了上面的me.el.燕子事件(['keypress','keydown']),并且它工作(mysql中的数据存储是多行的,但当我重新加载表单时它不工作:(我试图解决第二个问题。我的想法是检查textarea focus=true,然后不运行(我问题中的第三个代码)但我知道设置焦点是这样的。down('textarea')。focus(true,100);但我不知道如何检查是否有焦点?
enableKeyEvents: true,
listeners: { 
                afterrender: function(){
                    var me = this;
                     me.el.swallowEvent(['keypress','keydown'    ]); 
                }
            }