2011-11-23 45 views
0

當我在html視圖上編輯一些數據時,我沒有問題提交併保存,但是當我切換到源代碼視圖時,它不提交我所做的更改。htmleditor Extjs 4.0上的源代碼按鈕

的HTML編輯的初始化看起來是這樣的:

Ext.tip.QuickTipManager.init(); 
    var html = Ext.create('Ext.form.field.HtmlEditor', { 
     renderTo: 'content_ext', 
     width: 800, 
     height: 300, 
     listeners: { 
      render: function(me,content){ me.setValue(Ext.get('form_content_html').dom.value); }, 
      sync: function(me,content){ Ext.get('form_content_html').dom.value = content; } 
     } 
    }); 

任何想法?

回答

0

在源代碼視圖文本中有下面的純文本。 API告訴當textarea用編輯器的內容更新時觸發同步,所以也許你應該綁定到另一個事件?嘗試keydown on textarea:

render: function(){ 
    this.textareaEl.on('keydown', function() { 
     /* do sth */ 
    }, this, { buffer: 100 }); 
}