[CLOSED] Change color of text in <ext:StatusBar

Page 1 of 2 12 LastLast
  1. #1

    [CLOSED] Change color of text in
    Hi I would like to change the text color in <ext:StatusBar, How can I do that. I want the text to be red when I show error messages.
    I tried the StyleSpec="color: Red;" but that did not work.


    /Mikael

  2. #2

    RE: [CLOSED] Change color of text in
    Hi Mikael,

    Just use span tag with style
    TextItem1.Text = "Some text";

  3. #3

    RE: [CLOSED] Change color of text in
    Hi
    Yes, i tried that to. But then the text gets another alignment, it moves up a couple of pixeles. looks really bad.

    /Mikael

  4. #4

    RE: [CLOSED] Change color of text in
    It seems that you have predefined styles for two span (I mean span with inner span).
    Try it in clear simple project.
    There is my test case (I don't see any difference except color)

    <%@ Page Language="C#" %>
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!Ext.IsAjaxRequest)
            {
                TextItem1.Text = "Some text1";
                TextItem2.Text = "Some text2";
            }
        }
        
        protected void ChangeText_Click(object sender, AjaxEventArgs e)
        {
            TextItem1.Text = "Changed text1";
            TextItem2.Text = "Changed text2";
        }
    </script>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title>Example</title>
        
    </head>
    <body style="padding:10px;">
        <form id="form1" runat="server">
            <ext:ScriptManager ID="ScriptManager2" runat="server" StateProvider="PostBack" />
     
    
            <ext:Panel ID="Panel1" runat="server" Title="Panel with toolbar" Width="600" Height="300">
                <TopBar>
                    <ext:Toolbar ID="Toolbar1" runat="server">
                        <Items>                      
                            <ext:ToolbarTextItem ID="TextItem1" runat="server"></ext:ToolbarTextItem>
                            
                            <ext:ToolbarSeparator/>
                            
                            <ext:ToolbarButton runat="server" Text="Change Text">
                                <AjaxEvents>
                                    <Click OnEvent="ChangeText_Click"></Click>
                                </AjaxEvents>
                            </ext:ToolbarButton>
                            
                            <ext:ToolbarSeparator/>
                            
                            <ext:ToolbarTextItem ID="TextItem2" runat="server"></ext:ToolbarTextItem>
                        </Items>
                    </ext:Toolbar>
                </TopBar>           
            </ext:Panel>
        </form>
    </body>
    </html>
    Also you can try to set class='ytb-text' for span (it is set orginal paddings values)
    TextItem1.Text = "Some text1";

  5. #5

    RE: [CLOSED] Change color of text in
    Hi
    This example shows my problem. Im using the StatusBar, not toolbar. Whats the differece between them anyway?


    
    
    
    <%@ Page Language="C#" %>
    
    
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    
    
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    
    <script runat="server">
    
    
    protected void Page_Load(object sender, EventArgs e)
    
    
    {
    
    
    if(!Ext.IsAjaxRequest)
    
    
    {
    
    
    sbBottombar.SetText("Text");
    
    
    }
    
    
    }
    
    
    protected void ChangeText_Click(object sender, AjaxEventArgs e)
    
    
    {
    
    
    sbBottombar.SetText("Changed text1");
    
    
    }
    
    
    </script>
    
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    
    
    <head id="Head1" runat="server">
    
    
    <title>Example</title>
    
    
    </head>
    
    
    <body style="padding:10px;">
    
    
    <form id="form1" runat="server">
    
    
    <ext:ScriptManager ID="ScriptManager2" runat="server" StateProvider="PostBack" />
    
    
     
    
    
    <ext:Panel ID="Panel1" runat="server" Title="Panel with toolbar" Width="600" Height="300">
    
    
    <TopBar>
    
    
    
    
    
    <ext:StatusBar 
    
    
    ID="sbBottombar" 
    
    
    runat="server" 
    
    
    DefaultText="">
    
    
    <Items>
    
    
    <ext:ToolbarButton ID="ToolbarButton1" runat="server" Text="Change Text">
    
    
    <AjaxEvents>
    
    
    <Click OnEvent="ChangeText_Click"></Click>
    
    
    </AjaxEvents>
    
    
    </ext:ToolbarButton>
    
    
    
    
    
    
    
    
    </Items>
    
    
    </ext:StatusBar>
    
    
    </TopBar> 
    
    
    </ext:Panel>
    
    
    </form>
    
    
    </body>
    
    
    </html>

  6. #6

    RE: [CLOSED] Change color of text in
    Hi Mikael,

    Sorry, I missed that you mentioned about StatusBar. For StatusBar TextItem need to set class='x-status-text'
    sbBottombar.SetText("Changed text1");
    Hope this help

  7. #7

    RE: [CLOSED] Change color of text in
    Just a small correction. We found that in FF there is small padding if use span. Therefor it will be useful to set padding:0px;

    sbBottombar.SetText("Changed text1");

  8. #8

    RE: [CLOSED] Change color of text in
    Thanks works great! Sorry for beeing annoying, but is there a way of using a class that sets the red color instread of specifying a color on every place this is used?

    sbBottombar.SetText("Changed text1");
    this does not work.

  9. #9

    RE: [CLOSED] Change color of text in
    hmm...

    It should works. May be you made a mistake in css rule. Here is my css rule which works great

       <style type="text/css">
            .redText
            {
                color:red;
                padding:0px !important;
            }
        </style>
    sbBottombar.SetText("Changed text1");

  10. #10

    RE: [CLOSED] Change color of text in


    Hi,
    I dont get the CSS to work, please try this simple example. This text does not get red for me, when the button is clicked. Does this work for you?


    
    <%@ Page Language="C#" %>
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    
    
    <script runat="server">
    protected void Page_Load(object sender, EventArgs e)
    {
        if(!Ext.IsAjaxRequest)
        {
    
    
            sbBottombar.SetText("Text");
        }
    }
    
    
    protected void ChangeText_Click(object sender, AjaxEventArgs e)
    {
        sbBottombar.SetText("Changed text1");
    }
    </script>
    
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
    <title>Example</title>
    
    
    <style type="text/css">
       .redTextTEST        
       {
        color:red;
        padding:0px !important;
       }
    </style>  
    
    
    
    </head>
    <body style="padding:10px;">
    <form id="form1" runat="server">
    <ext:ScriptManager ID="ScriptManager2" Theme="Slate" runat="server" StateProvider="PostBack" />
    
    
    
    <ext:Panel ID="Panel1" runat="server" Title="Panel with toolbar" Width="600" Height="300">
    
    
    <TopBar>
    
    
                    
                    <ext:StatusBar 
                        ID="sbBottombar" 
                        runat="server"  
                        DefaultText="">
                        <Items>
    
    
                    <ext:ToolbarButton ID="ToolbarButton1" runat="server" Text="Change Text">
                    <AjaxEvents>
                    <Click OnEvent="ChangeText_Click"></Click>
                    </AjaxEvents>
                    </ext:ToolbarButton>
                        
                            
                        </Items>
                    </ext:StatusBar>
    
    
    </TopBar> 
    </ext:Panel>
    </form>
    </body>
    </html>

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 2
    Last Post: Jul 11, 2012, 5:18 PM
  2. [CLOSED] How to change text color in Ext Button
    By UnifyEducation in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Jun 25, 2012, 1:42 PM
  3. Replies: 2
    Last Post: Dec 29, 2011, 2:11 AM
  4. Replies: 12
    Last Post: Jun 17, 2009, 12:07 PM
  5. [CLOSED] Multiline Text Problem in StatusBar
    By thedarklord in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: May 23, 2009, 4:13 PM

Posting Permissions