[CLOSED] Change background color of MultiSelect

  1. #1

    [CLOSED] Change background color of MultiSelect

    Hi
    How do I change the color or the multiselect? I want to color it red, during an ajax event.

    /Mikael
  2. #2

    RE: [CLOSED] Change background color of MultiSelect

    I tried to set the "cls" property like this. but no luck.

    //Style
    .MultiSelectErrorColor .x-fieldset-bwrap
    {
        background: silver !important;
        border-color:Gray !important;
        background-color: Red !important;;
    
    } 
    
    
    //.NET Code
    msRooms.Cls = "MultiSelectErrorColor";
    /mikael
  3. #3

    RE: [CLOSED] Change background color of MultiSelect

    Hi Mikael,

    Please see the following sample:
    <%@ 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">
    
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head id="Head1" runat="server">
        <title></title>
        
        <script runat="server">
            protected void Click(object sender, AjaxEventArgs e)
            {
                System.Threading.Thread.Sleep(1500);
            }
        </script>
        
        <style type="text/css">
            .red .ux-mselect
            {
                background-color: Red !important;
            }
        </style>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ScriptManager ID="ScriptManager1" runat="server" />
            
            <ext:MultiSelect ID="MultiSelect1" runat="server" Width="300" Height="250">
                <Items>
                    <ext:ListItem Text="Item 1" Value="1" />
                    <ext:ListItem Text="Item 2" Value="2" />
                    <ext:ListItem Text="Item 3" Value="3" />
                    <ext:ListItem Text="Item 4" Value="4" />
                    <ext:ListItem Text="Item 5" Value="5" />
                </Items>
            </ext:MultiSelect>      
            
            <ext:Button runat="server" Text="Ajax event">
                <AjaxEvents>
                    <Click OnEvent="Click" 
                        Before="#{MultiSelect1}.addClass('red');" 
                        Success="#{MultiSelect1}.removeClass('red');" 
                        Failure="#{MultiSelect1}.removeClass('red');">
                    </Click>
                </AjaxEvents>
            </ext:Button>
            
        </form>
    </body>
    </html>

  4. #4

    RE: [CLOSED] Change background color of MultiSelect



    Thanks! works like a charm!

    /Mikael

Similar Threads

  1. [CLOSED] Change background color of Toolbar
    By trieu.tran in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jun 06, 2012, 10:56 AM
  2. Replies: 2
    Last Post: Dec 29, 2011, 2:11 AM
  3. [CLOSED] How to change color of FlashComponent background
    By flormariafr in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Mar 01, 2010, 11:50 AM
  4. Replies: 12
    Last Post: Jun 17, 2009, 12:07 PM
  5. Change Tab background color or background image
    By georgelanes in forum 1.x Help
    Replies: 0
    Last Post: Nov 06, 2008, 3:55 PM

Posting Permissions