0

I need to display a correct title for my kendo confirmation box.

I have the following logic:

if ((Math.abs(newAmount) < Math.abs(Amount)) && newAmount != 0)
{            
     kendo.confirm(msg).then(function () {
                SaveData();
     }, function () {
     });
}
else {
        SaveData();
}

Every time confirmation is displayed I have "localhost" value in that.

How do I set it up, so it displays what I need.

I went through a lot of tutorials on Kendo. There are different ways offered, however, in my case I need to use kendo.confirm logic.

How do I do that?

tereško
  • 58,060
  • 25
  • 98
  • 150
gene
  • 2,098
  • 7
  • 40
  • 98

3 Answers3

0

I had the same problem with my Kendo Alert, I fixed it with the following solution:

myalert("mytext"); 

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

See my question and answer: How do I change the Kendo alert title?

Rico Koldi
  • 376
  • 2
  • 10
0

It is not possible to do this through JS.

However, you can achieve this by CSS.

.k-confirm .k-window-titlebar::before {
    content: 'Confirmation';
}

.k-confirm .k-window-titlebar .k-dialog-title {        
  display:none;
}

Override the Kendo CSS, content: 'Confirmation'; is the title of kendo.confirm.

Salomon Zhang
  • 1,553
  • 3
  • 23
  • 41
0

for me these work

function k_alert(id, title, message){
    //var title = "Operazione Non consentita.";
    //var message = " Soltanto il venditore autore dell'offerta puo cancellare il record.";
    var out ='<div id="' + id + '"></div>';
    var objtemplate = $(out).appendTo("body");
    eval(objtemplate);
    $("#" + id).kendoAlert({    
        title: title,
        content: message,
        messages:{
            okText: "OK"
        }
    }).data("kendoAlert").open()
    $("#" + id).siblings(".k-window-titlebar.k-dialog-titlebar.k-header").children("span").css("visibility", "visible"); 
}

function k_confirm(id, title, message){
    //var title = "Operazione Non consentita.";
    //var message = " Soltanto il venditore autore dell'offerta puo cancellare il record.";
    var out ='<div id="' + id + '"></div>';
    var objtemplate = $(out).appendTo("body");
    eval(objtemplate);
    $("#" + id).kendoConfirm({    
        title: title,
        content: message,
        messages:{
            okText: "OK"
        }
    }).data("kendoConfirm").open()
    $("#" + id).siblings(".k-window-titlebar.k-dialog-titlebar.k-header").children("span").css("visibility", "visible"); 
}
brass monkey
  • 5,841
  • 10
  • 36
  • 61
haimirick
  • 29
  • 1