Sep 29, 2009, 7:24 AM
Html Editor font color
Hi,
I need to set blue color while entering text in html editor. my code as follows
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td runat="server" id="Part1">
<ext:Panel ID="Panel1" runat="server" Border="false" >
<Body>
<ext:AnchorLayout ID="AnchorLayout1" runat="server">
<ext:Anchor Horizontal="100%" Vertical="100%">
<ext:HtmlEditor ID="htmleditor_edit" Width="650" Height="200" runat="server">
<Listeners>
<Render Handler="changeColor(this);" Delay="250" />
</Listeners>
</ext:HtmlEditor>
</ext:Anchor>
</ext:AnchorLayout>
</Body>
</ext:Panel>
</td>
<td runat="server" id="Part2">
<ext:Panel ID="Panel2" runat="server" Border="false">
<Body>
<ext:AnchorLayout ID="AnchorLayout2" runat="server">
<ext:Anchor Horizontal="100%" Vertical="100%">
<ext:HtmlEditor ID="htmleditor_read" Width="650" Height="200" runat="server" ReadOnly="true"
CtCls="hide-toolbar" >
</ext:HtmlEditor>
</ext:Anchor>
</ext:AnchorLayout>
</Body>
</ext:Panel>
</td>
</tr>
</table>
function changeColor(editor) {
var dbody = editor.getEditorBody();
var ss = {};
ss['color'] = 'blue';
Ext.DomHelper.applyStyles(dbody, ss);
}
by default htmleditor is noteditable when page is loaded, i call htmleditor_read to be visible.if new button is clicked then i show htmleditor_edit to be visible true for typing. At the time i get error. editor is null. 1. i need typing text should be in blue color.
2. how to use single htmleditor for typing and for not typing text.
i have used coolite version 0.8.2.