Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/symfony/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Kendo ui 如何在剑道UI中创建确认弹出窗口?_Kendo Ui_Kendo Asp.net Mvc - Fatal编程技术网

Kendo ui 如何在剑道UI中创建确认弹出窗口?

Kendo ui 如何在剑道UI中创建确认弹出窗口?,kendo-ui,kendo-asp.net-mvc,Kendo Ui,Kendo Asp.net Mvc,我有用于确认弹出窗口的jquery UI代码 if (confirm('Are you sure you want to delete the batchjob:' + dataItem["Name"])) { $.get("@Url.Content("~/BatchJob/DeleteBatchJob")", { batchJobDetailId: parseInt(dataItem["BatchJobDetailId"]) }, function (data) {

我有用于确认弹出窗口的jquery UI代码

if (confirm('Are you sure you want to delete the batchjob:' + 
 dataItem["Name"])) {
            $.get("@Url.Content("~/BatchJob/DeleteBatchJob")", { batchJobDetailId: parseInt(dataItem["BatchJobDetailId"]) }, function (data) {
                if (data) {
                    debugger
                   var batchJobValidateWnd = $("#ValidateBatchJobStatus").data("kendoWindow");
                    batchJobValidateWnd.content("BatchJob deleted successfully.");
                    batchJobValidateWnd.center().open();
                    $.post("@Url.Content("~/BatchJob/SearchBatchJobDetailByParams")", { jobName: $("#Name").val(), startDate: $("#ScheduleStartDate").val() }, function (data) {

                    });
                }
                else {
                    debugger
                    window.location = '@Url.Content("~/BatchJob/Create")/' + parseInt(dataItem["BatchJobDetailId"]);
                }
            });
        }

我需要剑道确认弹出窗口?如何将jquery确认弹出窗口更改为剑道确认弹出窗口

您可以通过承诺创建剑道确认对话框,如果确认,则以与jquery对话框相同的方式执行

对话框本身应使用在
按钮显示对话框
单击
事件上呈现的事件创建,该事件将在继续之前等待响应

<script id="confirmationTemplate" type="text/x-kendo-template">

<div class="popupMessage"></div>
  </br>
<hr/>
<div class="dialog_buttons">
    <input type="button" class="confirm_yes k-button" value="Yes" style="width: 70px" />
    &nbsp;
    <input type="button" class="confirm_no k-button" value="No" style="width: 70px" />
  </div>

</script>
下面是一个示例,演示上述代码的实际操作

$("#buttonDisplayDialog").kendoButton({
      click: function(e) {
        $.when(showConfirmationWindow('Are you sure you want to delete the batchjob:')).then(function(confirmed){

          if(confirmed){
            alert('This is where you will put confirmation code');
          }
          else{
            alert('User clicked no');
          }
        });
      }      
    });
  });

function showConfirmationWindow(message) {
    return showWindow('#confirmationTemplate', message)
  };

  function showWindow(template, message) {

    var dfd = new jQuery.Deferred();
    var result = false;

    $("<div id='popupWindow'></div>")
    .appendTo("body")
    .kendoWindow({
      width: "200px",
      modal: true,
      title: "",
      modal: true,
      visible: false,
      close: function (e) {
        this.destroy();
        dfd.resolve(result);
      }
    }).data('kendoWindow').content($(template).html()).center().open();

    $('.popupMessage').html(message);

    $('#popupWindow .confirm_yes').val('OK');
    $('#popupWindow .confirm_no').val('Cancel');

    $('#popupWindow .confirm_no').click(function () {
      $('#popupWindow').data('kendoWindow').close();
    });

    $('#popupWindow .confirm_yes').click(function () {
      result = true;
      $('#popupWindow').data('kendoWindow').close();
    });

    return dfd.promise();
  };