6

I'm using a Kendo alert and want to change the title of it. The default title is the url name, see link(image) below. I want to use my own title, how do I change this?

Image Kendo alert

The kendo alert:

kendo.alert("mytext");
Rico Koldi
  • 376
  • 2
  • 10

3 Answers3

14

I found a solution to change the title, I did the following:

myalert("mytext"); 

function myalert(content) {
    $("<div></div>").kendoAlert({
        title: "mytitle!",
        content: content
    }).data("kendoAlert").open();
}

Result: Image Kendo alert custom title

I hope this answer helps a lot of people with the same problem.

Rico Koldi
  • 376
  • 2
  • 10
  • Thanks a lot, it helped me to also set a few other properties while keeping the convenience of predefined kendo "alert" method. – AFract Jan 27 '20 at 16:36
2

you cannot change the Title it's possible to hide it using css:

.k-dialog .k-window-titlebar .k-dialog-title {
        visibility: hidden;
    }
Sooriya Dasanayake
  • 1,106
  • 1
  • 7
  • 14
0

As Kendo Alert inherits from Kendo Dialog, you can update the title with the title() method:

kendo.alert("Hello!").element.getKendoAlert().title("new title");

https://dojo.telerik.com/EGOKeQAl

You can chain the center() method if the alert is not centered after the title change.

kendo.alert("Hello!").element.getKendoAlert().title("new title").center();