如何将列ID或值传递给Kendo Grid中的删除确认

时间:2015-03-19 00:59:40

标签: kendo-ui kendo-grid

我想将列值传递给删除确认。您确定要删除"列值" ?我怎么能这样做?

我在下面的链接中找到了与我的问题相关的问题。我希望扩展这个答案。

How to change the text on Kendo UI Grid destroy or delete command action?

1 个答案:

答案 0 :(得分:0)

您可以使用函数代替硬编码字符串作为确认消息

$("#grid").kendoGrid(
  {
    dataSource: dataSource,
    columns: [
      "ProductName",
      { field: "UnitPrice", title: "Unit Price", format: "{0:c}", width: "120px" },
      { field: "UnitsInStock", title:"Units In Stock", width: "120px" },          
      { field: "Discontinued", width: "120px" },
      { command: ["edit", "destroy"], title: " ", width: "250px" }],
      editable: {
        mode: "inline",
        confirmation: function(e){
          return  "Are you sure that you want to delete record for " + e.ProductName + "?";
        }
      }
});

示例here