Extjs 使用EXT JS在TextArea中开始写入时启用按钮

Extjs 使用EXT JS在TextArea中开始写入时启用按钮,extjs,Extjs,我需要启用一个按钮,比如说Submit按钮,当用户开始使用ExtJS在TextArea中写作时。 开始时,由于TextArea为空,Submit按钮被禁用。只要用户开始在TextArea中写入,它就应该被启用。 请告诉我是否有任何事件跟踪EXT JS中TextArea中的书写,类似的事情应该做- { xtype : 'textareafield', grow : true, name : 'MyTextField', fieldLabel: 'MyTextField'

我需要启用一个按钮,比如说Submit按钮,当用户开始使用ExtJS在TextArea中写作时。 开始时,由于TextArea为空,Submit按钮被禁用。只要用户开始在TextArea中写入,它就应该被启用。
请告诉我是否有任何事件跟踪EXT JS中TextArea中的书写,类似的事情应该做-

{
xtype     : 'textareafield',
grow      : true,
name      : 'MyTextField',
fieldLabel: 'MyTextField',
listeners : {
    blur: function(event, eOpts){
        // here you can get reference to the button and enable
    },
    change: function(newValue, oldValue, eOpts) {
        // this event will be fired whenever the value of the text field changes when you type.
        // You can even listen to this function and enable the button when this event fires
    }
}
}


要获得您可以收听的事件列表,我建议您查看API文档。以下是使用:
formBind:true
将根据表单的有效状态启用/禁用

    Ext.create('Ext.form.FormPanel', {
        title      : 'Sample TextArea',
        width      : 400,
        bodyPadding: 10,
        renderTo   : Ext.getBody(),
        items: [{
            xtype     : 'textareafield',
            grow      : true,
            allowBlank: false,
            name      : 'message',
            fieldLabel: 'Message',
            anchor    : '100%'                
        },{
            xtype: 'button',
            text: 'My Button',
            formBind: true,
            disabled: true
        }]
    });

您可以收听更改事件。