【问题标题】:Source code button on htmleditor Extjs 4.0htmleditor Extjs 4.0 上的源代码按钮
【发布时间】:2011-11-23 15:20:55
【问题描述】:

当我在 html 视图上编辑一些数据时,提交并保存它没有问题,但是当我切换到源代码视图时,它不会提交我所做的更改。

htmleditor 的 init 如下所示:

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; }
        }
    });

有什么想法吗?

【问题讨论】:

    标签: javascript extjs html-editor


    【解决方案1】:

    在源代码视图文本下面有纯文本区域。 API 告诉当 textarea 使用编辑器中的内容更新时触发同步,所以也许你应该绑定到另一个事件?在 textarea 上尝试 keydown:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-29
      • 2012-02-07
      • 1970-01-01
      • 2012-12-28
      • 1970-01-01
      相关资源
      最近更新 更多