How can i change Dialog header color & fontWeight

Hello, Syncfusion Teams.


i want to change header fontWeight and color in Dialog.

i tried something. but, i can't.


can you give a solution?


i tried to code something like below. please check.

thanks.


dialog error.png


var subject = document.getElementById('confirm_Delete').ej2_instances[0];
subject.header = "ARE YOU SURE TO CONFIRM THE DATA?";
subject.element.style.fontWeight = "bold";
subject.element.style.color = "red";


var alertText = document.getElementById('confirm_Delete_Text');
alertText.innerText = "YOU CAN'T MODIFY THE DATA AFTER CONFIRMATION IN THIS REVISION.ARE YOU SURE TO CONFIRM THE DATA?";
alertText.style.fontWeight = "bold";
deleteObj.show();

1 Reply

BS Buvana Sathasivam Syncfusion Team March 24, 2022 03:12 PM UTC

Hi TaeWook, 

Greetings from Syncfusion support. 

By obtaining the dialog header element and assigning styles, you can change the font weight and color of the dialog header. Please see the code and sample below for your reference. 

<ejs-dialog id="confirm_dialog" open="dialogOpen">…. </ejs-dialog> 
 
<script> 
        function dialogOpen() { 
            var subject = document.getElementById('confirm_dialog').ej2_instances[0]; 
            subject.header = "ARE YOU SURE TO CONFIRM THE DATA?"; 
            subject.element.querySelector(".e-dlg-header").style.fontWeight = "bold"; 
            subject.element.querySelector(".e-dlg-header").style.color = "red"; 
            buttons.classList.add('e-btn-hide'); 
        } 
    </script> 
  

Regards, 
Buvana S 


Loader.
Up arrow icon