Custom Delete Confirmation popup on Kendo Grid

2020-07-10 11:33发布

I have a Kendo grid where I need to customize the delete confirmation message box based on data in row being deleted. I have a customized general message as part of Grid configuration as below.

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

I was looked at using the remove event handler, but that fires after the row has been deleted.

3条回答
Summer. ? 凉城
2楼-- · 2020-07-10 12:16

Kendo has a demo on that you can try. But this is probably the latest version so it may not work well with the older versions.

Please check "Customize the delete confirmation dialog of Kendo UI Grid" on their official website, here.

For older versions you can check "Using a Kendo UI Window as a confirmation prompt in a Grid" in Telerik Forum here.

查看更多
Evening l夕情丶
3楼-- · 2020-07-10 12:17

I am guessing you will need to do this manually. Simply add a custom button to the grid, that calls your code to delete the item.

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

Sample jsbin http://jsbin.com/OZeLuXA/1/edit

查看更多
迷人小祖宗
4楼-- · 2020-07-10 12:19

HTML code

<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 code

   $(function () {
       $("#btnClickMe").click(function () {
           // This is for [Warning / Information / Confirm / Error] dialog box.
           confirmDialogMSG("Error", 
                                "Inflow encountered some internal error.", 
                                "Error",  ["OK"],  null);
       });
   });
查看更多
登录 后发表回答