htmleditor Extjs 4.0 上的源代码按钮

发布于 2024-12-18 02:00:33 字数 540 浏览 6 评论 0原文

当我在 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; }
        }
    });

Any idea?

When i edit some data on the html view i got no problem to submit it and save it but when i switch to the source code view it doesn't submit the changes i do.

The init of the htmleditor looks like this:

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

Any idea?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

忆悲凉 2024-12-25 02:00:33

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

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

In source code view text there is plain textarea underneath. API tells that sync is fired when the textarea is updated with content from the editor, so maybe you should bind to another event? Try keydown on textarea:

render: function(){
    this.textareaEl.on('keydown', function() {
        /* do sth */
    }, this, { buffer: 100 });
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文