Change button color after clicked

  1. #1

    Change button color after clicked

    PressedCls not available in Ext JS 6

    <%@ Page Language="C#" %>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title>Ext.NET v4 Example</title>
    
        <style>
            .button {
                background-color : #4e9a06;
            }
            .x-over {
                background-color : #f57900;
            }
            .button.x-button-pressed {
                background-color : #4e9a06 !important;
            }
    
        </style>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            
            <ext:Button
                runat="server" 
                Text="Button" 
                Border="false"
                Cls="button"
                OverCls="x-over" 
                />
        </form>
    </body>
    </html>
  2. #2
    Hello @rickywu!

    Please double check how you are specifying your CSS class.

    Also, it is not 'button' but 'btn'. Just 'inspect element' on your browser and click (and hold) a button while looking at the DOM CSS classes bound to it.

    Click image for larger version. 

Name:	61284-buttonPressed.png 
Views:	134 
Size:	23.4 KB 
ID:	24678

    Hope it helps!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. [CLOSED] How to change row background-color when clicked command
    By CPA1158139 in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Jun 21, 2014, 10:33 AM
  2. [CLOSED] Change background color of button
    By Pablo_Azevedo in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 17, 2013, 2:17 PM
  3. [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
  4. Change Radio button label color
    By Elie.fakhry in forum 1.x Help
    Replies: 5
    Last Post: Sep 23, 2010, 10:54 PM
  5. Replies: 3
    Last Post: Feb 02, 2010, 6:32 PM

Posting Permissions