HOW TO CHANGE BACKGROUND COLOR OF EXT.MSG.ALERT SENCHA TOUCH

Samuel Fernandes

Total Post:159

Points:1117
Posted by  Samuel Fernandes
 3573  View(s)
Ratings:
Rate this:
Hi,

I want to change the background color of alert message box in Sencha Touch but I don’t have any idea about it. By default Sencha Touch shows the black background color of alert box but I want to custom color. So please let me know what is correct way to perform this task?

Here I'm trying to add custom class with alert dialog box but it is not working.

CSS:

 .test{ Background-color: #d21c1c !important; }

Dialog code:

var dialog = Ext.Msg.alert("Custom alert box!"); 
dialog.getDialog().addClass('testcolor');

Thanks in advance. 

  1. AVADHESH PATEL

    Post:604

    Points:4228
    Re: How to change background color of Ext.Msg.alert Sencha touch

    Hi Samuel,


    Use below css classes to change MessageBox bg color and MessageBox text properties.

    // To change messagebox background color

    .x-msgbox
     {
        background-color: #fff;
     }

    // To change messagebox text properties
     .x-msgbox-dark .x-msgbox-text {
        color: #000 !important;
        font-size: 14px;
        font-family: Helvetica, Arial, sans-serif;
    }

    // To change messagebox title
    .x-toolbar-dark .x-title {
        color:#000 !important;
        font-size: 20px !important;
        font-family: Helvetica, Arial, sans-serif;
    }

    It may be helpful for you.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!