Kendo UI提示仅1个按钮

时间:2019-03-07 01:07:21

标签: kendo-ui kendo-grid

问候所有

我正在使用KENDO UI PROMPT。

  1. 我想将“ 确定”重命名为“ 解锁
  2. 我要删除“ 取消”按钮,因此此提示上只有1个按钮可用。有可能吗?如果没有,我的情况是否有这样的选择?

$("#promptBtn").on("click", function () {
  window.myprompt("Please enter password!").then(function (data) {
    window.location.pathname = "unlock.php";
  })
});


function myprompt(content, defaultValue){
  return $("<div></div>").kendoPrompt({
    title: "Lock Session",
    content: content
  }).data("kendoPrompt").open().result;
}
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>Kendo UI Snippet</title>

    <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2019.1.220/styles/kendo.common.min.css"/>
    <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2019.1.220/styles/kendo.rtl.min.css"/>
    <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2019.1.220/styles/kendo.silver.min.css"/>
    <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2019.1.220/styles/kendo.mobile.all.min.css"/>

    <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
    <script src="https://kendo.cdn.telerik.com/2019.1.220/js/kendo.all.min.js"></script>
</head>
<body>
  
<button id="promptBtn" class="k-button">myprompt</button>

</body>
</html>

1 个答案:

答案 0 :(得分:0)

好吧,我想它不能做到这一点,所以我需要为此使用kendoWindow!

public class Trade
{
    public string AccountId
    {
        get;
        set;
    }

    public string SalesCode
    {
        get;
        set;
    }

    public decimal PrincipalAmount
    {
        get;
        set;
    }

    public decimal GrossBrokerage
    {
        get;
        set;
    }

    public decimal NetBrokerage
    {
        get;
        set;
    }
}
var lockScreen = $("#lockScreen");
lockScreen.kendoWindow({
  visible: false,
  width: "200px",
  height: "130px",
  actions: [],
  modal: true,
  title: "LOCKED!"
});
$("#menuLock").click(function() {
    lockScreen.data("kendoWindow").center().open();
}); 
 *{font-size:11px;	font-family:Arial;}