在 HTML 编辑器中键入文本时,我需要选中该复选框。当我单击 HTML 编辑器工具栏上的源代码编辑按钮时,以下代码可以正常工作。禁用所有按钮后,复选框被选中。任何人都可以更正代码吗?
这是extjs代码:
this.mcmServiceIndicatorsOthCheckbox = new Ext.form.field.Checkbox({ fieldLabel: '', id: 'otherbox', boxLabel: 'OTH (must complete comments)' });
this.mcmServiceIndicatorsCommentsHtmlEditor = new Ext.form.HtmlEditor({
            height: 50,
            style: 'background-color: white;',
            enableSourceEdit : true,
            anchor: '100%',             
                listeners: {
                    afterrender: function(){
                      this.textareaEl.on('keyup', function() {
                         var notes = this.getValue(); 
                          if(notes.length > 0)
                          {
                              Ext.getCmp('otherbox').setValue(true);
                          }
                          else
                          {
                              Ext.getCmp('otherbox').setValue(false);
                          } 
                      });              
                    }
                }
        });