我有一个文本框,上面写了一些文字。现在,当有人在文本框中单击时,我打开了一个html编辑器(http://docs.sencha.com/ext-js/3-4/#!/api/Ext.form.HtmlEditor),现在我想将文本框中编写的文本放入html编辑器中,以便用户可以轻松地对其进行编辑和保存。类似地,当我打开html编辑器时,我想要更新颜色框中的值以及html编辑器中的font-size和font-value。假设我可以从文本框中获取这些值。我试着用谷歌搜索了一下,但找不到该怎么做。
Ext.QuickTips.init(); // enable tooltips
new Ext.Panel({
renderTo: 'text-editor',
id: 'html-editor',
width: 440,
height: 100,
frame: true,
layout: 'fit',
items: [
{
xtype: 'htmleditor',
enableColors: true,
enableAlignments: true
}
]
});
$('#selected-text-box').click(function() {
showEditor(this.id);
//TODO: Write code here to set the properties of editor with the properties set in textbox
});现在,我只想问一下。如何访问html编辑器中的字段并设置它们的值。
发布于 2012-05-01 13:53:37
试试这个,我会工作的,但关于字体大小我不知道
var Content = $('#' + textBoxId).html();
editor.setValue(Content);我已经试过了。它是有效的:)
https://stackoverflow.com/questions/10373933
复制相似问题