在Kendo Grid上自定义删除确认弹出窗口

时间:2013-12-26 14:06:49

标签: kendo-ui kendo-grid

我有一个Kendo网格,我需要根据要删除的行中的数据自定义删除确认消息框。我有一个自定义的常规消息作为网格配置的一部分,如下所示。

 editable: {
     confirmation: "Are you sure that you want to delete this record?",
     mode: "popup",
     template: kendo.template($("#popup-editor").html())
}

我看过使用remove事件处理程序,但在删除该行后会触发。

3 个答案:

答案 0 :(得分:4)

我猜您需要手动执行此操作。只需在网格中添加一个自定义按钮,即可调用代码删除该项目。

Kendo Grid Custom命令http://demos.kendoui.com/web/grid/custom-command.html

示例jsbin http://jsbin.com/OZeLuXA/1/edit

答案 1 :(得分:1)

剑道有一个你可以尝试的演示。但这可能是最新版本,所以它可能不适用于旧版本。

请在其官方网站here上查看“自定义Kendo UI Grid的删除确认对话框”。

对于旧版本,您可以在Telerik论坛here中选中“在网格中使用Kendo UI窗口作为确认提示”。

答案 2 :(得分:0)

HTML代码

<div>
      <div id="div_alert_window"></div>
      <div class="dialog button">
             click on dialog: <input type="button" value="click me!" id="btnClickMe" />
      </div>
</div>

Js代码

   $(function () {
       $("#btnClickMe").click(function () {
           // This is for [Warning / Information / Confirm / Error] dialog box.
           confirmDialogMSG("Error", 
                                "Inflow encountered some internal error.", 
                                "Error",  ["OK"],  null);
       });
   });