如何在MVC中为剑道确认设置标题?

时间:2018-02-07 17:04:43

标签: asp.net-mvc title kendo-confirm

我需要为kendo确认框显示正确的标题。

我有以下逻辑:

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

每次显示确认信息时,我都有&#34; localhost&#34;在那里的价值。

如何设置,以便显示我需要的内容。

我在Kendo上经历了很多教程。提供了不同的方法,但在我的情况下,我需要使用kendo.confirm逻辑。

我该怎么做?

3 个答案:

答案 0 :(得分:0)

我的Kendo Alert遇到相同的问题,我通过以下解决方案对其进行了修复:

myalert("mytext"); 

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

查看我的问题和答案:How do I change the Kendo alert title?

答案 1 :(得分:0)

不可能通过JS做到这一点。

但是,您可以通过CSS来实现。

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

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

覆盖Kendo CSS,content: 'Confirmation';kendo.confirm的标题。

答案 2 :(得分:0)

对我来说这些工作

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"); 
}