Set properties of extJs htmleditor
-
04-06-2021 - |
Question
I have a text box and there is some text written on it. Now, when somebody clicks inside the text box, I open a html editor (http://docs.sencha.com/ext-js/3-4/#!/api/Ext.form.HtmlEditor) and now i want to place the text written inside the text box to come in the html editor so that user can edit it easily and save it. Similarly, when i open the html editor i want to update the value inside the color box and font-size and font-value in the html editor. Assume that i can fetch these values from the textbox. I tried googling it but could not found how to do this.
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
});
Now, i just want to ask. how to access the fields of html editor and set their value.
Solution
Try this, I will work but about font-size I don't know
var Content = $('#' + textBoxId).html();
editor.setValue(Content);
I have tried this. It works :)