[CLOSED] Changing the background color of htmleditor

  1. #1

    [CLOSED] Changing the background color of htmleditor

    Hi,

    I have a css class

    .highlight {
    background: #ffffcc !important;
    }
    <ext:HtmlEditor ID="HtmlEditorEditt"  Cls="Highlight"  runat="server" Height="245"  AutoScroll="true" EnableLists="true" EnableColors="true" EnableFormat="true" EnableTheming="true"   EnableSourceEdit="false" EnableFontSize="false"     AnchorHorizontal="100%"  FieldLabel="<%$ Resources:WebResources|BusinessProcessConfiguration.FormLabels, CommentDetail %>" >
                                        
                                      </ext:HtmlEditor>
    This css works for textfield when i set it to the cls property. But does not work for HtmlEditor. How Do i set the background color of the textarea of htmleditor.

    regards
    Last edited by Daniil; Jan 22, 2012 at 4:01 PM. Reason: [CLOSED]
  2. #2
    Never mind. I used the addclass method on the afterrender event to add the css and it works. I wonder why it cant be added declaratively.

    Please close thread
  3. #3
    Hi,

    It's not so easy in HtmlEditor case. Its body is an iframe in edit mode and managed, generally, by a browser.

    Though it's possible to change background color, please see the example below.

    Example
    <%@ Page Language="C#" %>
     
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.NET Example</title>
     
        <script type="text/javascript">
            var onInitialize = function (editor) {
                var styles = {
                    "background-image" : "none",
                    "background-color" : "red"
                };
                Ext.DomHelper.applyStyles(editor.getEditorBody(), styles);
            };
        </script>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:HtmlEditor
                runat="server"
                Width="200"
                Height="200">
                <Listeners>
                    <Initialize Fn="onInitialize" />
                </Listeners>    
            </ext:HtmlEditor>
        </form>
    </body>
    </html>

Similar Threads

  1. Replies: 7
    Last Post: Jul 11, 2012, 1:12 PM
  2. [CLOSED] GridPanel.Rows.Changing Background Color of Rows
    By supera in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 01, 2012, 5:18 PM
  3. Replies: 1
    Last Post: Nov 24, 2011, 6:48 AM
  4. Changing TreePanel background color
    By wexman in forum 1.x Help
    Replies: 3
    Last Post: Apr 06, 2011, 2:35 PM
  5. [CLOSED] Changing background color of TabPanel on the fly
    By rmelancon in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Oct 07, 2010, 12:23 PM

Tags for this Thread

Posting Permissions