Html Editor font color

  1. #1

    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.


  2. #2

    RE: Html Editor font color

    Hi,

    1. Blue color. Please see the following discussion http://forums.ext.net/showthread.php?5186

    Also you can wrap you text with "<p style='color:blue'>'"
    HtmlEditor1.Text = string.Format("{0}", editorText);
    2. Do not use Visible property, use Hidden. If you set Visible="false" then control doesn't render at all and can be rendered after postback only

    3. Use single HtmlEditor and swith ReadOnly

    Server-Side (AjaxEvent)
    HtmlEditor1.ReadOnly = false;
    JS
    HtmlEditor1.setReadOnly(false);
    Last edited by geoffrey.mcgill; Feb 20, 2011 at 3:52 PM.
  3. #3

    RE: Html Editor font color



    Hi,

    I need the tying text color in blue(by default) and this is done in client side.
    The js function works fine on coolite version 0.8 but after i update svn then i get this problem.

    My js is not working when i click new it show js error.
    The error is editor is null.


    function changeColor(editor) {
    var dbody = editor.getEditorBody();
    var ss = {};
    ss['color'] = 'blue';
    Ext.DomHelper.applyStyles(dbody, ss);
    }
    var dbody is null....

    On loading the page the i shows <td runat="server" id="Part2"><visible> and <td runat="server" id="Part1"><not visible>
    On clicking the new button i show <td runat="server" id="Part1"><visible> and <td runat="server" id="Part2">< not visible>

  4. #4

    RE: Html Editor font color

    Hi,

    Please post example which we can test. It is hard to say whats wrong without example


    If you call 'changeColor(this)' then editor cannot be null because 'this' is never null. It is mean that you call that function somewhere else. Therefore provide an example, please
  5. #5

    RE: Html Editor font color



    Hi,

    I used single html editor.
    1. On pageload, by default i set Htmleditor1.readonly=true; and Htmleditor1.CtCls="hide-toolbar" it work fine.

    2. On clicking new button i set Htmleditor1.readonly=false; and Htmleditor1.CtCls=""; but its not working.

    3. on saving i need to set this Htmleditor1.readonly=true; and Htmleditor1.CtCls="hide-toolbar". how to do this.
  6. #6

    RE: Html Editor font color

    Hi,

    Please provide the example for testing because I don't see where you set those properties (server or clien side), on which step you set it, how you set and what you set

Similar Threads

  1. html editor highlight and text color buttons
    By [WP]joju in forum 1.x Help
    Replies: 5
    Last Post: May 06, 2010, 8:38 AM
  2. [CLOSED] set Html Editor Default font colour
    By speedstepmem3 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Sep 18, 2009, 6:58 AM
  3. [CLOSED] Editor Font Color Dropdown
    By HOWARDJ in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Sep 16, 2009, 12:36 PM
  4. [CLOSED] Html Editor Default Color
    By speedstepmem2 in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Apr 06, 2009, 1:59 AM
  5. How to change default font of HTML Editor
    By VietView in forum 1.x Help
    Replies: 0
    Last Post: Mar 25, 2009, 8:22 AM

Posting Permissions