dojodefaultconfirm-dialog

Dijit ConfirmDialog - change its default style


How to change the default style (bar color, content color, etc) of the dijit ConfirmDialog? Please see codes below. Neither width or color were changed for the Confirm Dialog.

var confirm = new ConfirmDialog({
    title: "Confirmation",
    content: "This is the content", 
    style: "width: 400px, color: grey"
}).show();


Solution

  • I believe you just need to change the , to a semi-colon ;

    var confirm = new ConfirmDialog({
        title: "Confirmation",
        content: "This is the content", 
        style: "width: 400px; color: grey"
    }).show();
    

    BTW, the color property in style is just the content color. To change the title bar background color, this link says:

    You'd have to override the background-color on the .dijitDialogTitleBar css. For example,

    <link rel="stylesheet" type="text/css" href="dojo-release-1.6.1-src/dojo/resources/dojo.css" />
    <link rel="stylesheet" type="text/css" href="dojo-release-1.6.1-src/dijit/themes/claro/claro.css" />
    
    <style> .claro .dijitDialogTitleBar { background-color: #00FF00 } </style>
    

    Here, the color is changed to green.