【问题标题】:How to change the text on Kendo UI Grid destroy or delete command action?如何更改 Kendo UI Grid 上的文本销毁或删除命令操作?
【发布时间】:2012-09-16 05:12:47
【问题描述】:

我正在使用 KendoUI KendoGrid。我有一个带有删除按钮或“销毁”操作的列。 Kendo 会显示一个警告框,其中包含文本“您确定要删除此记录吗?”我需要这个文本更具体地针对我的情况。您如何自定义此文本?

任何帮助将不胜感激。

我添加列的代码是:

$reports.kendoGrid(
{
    dataSource: dataSource,
    pageable: {
        refresh: true,
        pageSizes: true
    },
    toolbar: [{ name: "create", text: "Add" }],
    columns:
    [
        { field: 'name', title: 'Report', sortable: true },
        { command: ["edit", "destroy"], title: " ", width: "180px", } 
    ],
    editable: "inline",
    selectable: true,

【问题讨论】:

    标签: c# javascript jquery telerik kendo-ui


    【解决方案1】:

    根据Kendo Grid documentation

    editable.confirmation 布尔值 |字符串

    定义删除项目时将在确认框中使用的文本。

    【讨论】:

    • 谢谢:我将以下行放入可编辑:可编辑:{模式:“内联”,确认:“哦,疯了!您确定要删除此报告和所有部分全部内容?” },
    【解决方案2】:

    如果你使用的是 ASP.NET MVC 的 Kendo UI,你可以使用 DisplayDeleteConfirmation

            @(Html.Kendo().Grid<OrdersViewModel>()
                  .Name("Orders")
                  .HtmlAttributes(new {style = "height: 100%; border-width: 0;"})
                  .Columns(c =>
                      {
                         c.Bound(p => p.Id)
                         .Width(50)
                      }
                 .Editable(editable =>
                      {
                         editable.Mode(GridEditMode.InLine);
                         editable.DisplayDeleteConfirmation("Your Message here");
                      }))
    

    【讨论】:

    • 但是如何传递订单以在 DeleteConfirmation 消息中显示呢?
    【解决方案3】:

    替换

    editable: "inline"
    

    editable: {
        confirmation: "Your custom message",
        mode: "inline"
    },
    

    【讨论】:

      猜你喜欢
      • 2012-11-02
      • 1970-01-01
      • 2014-12-17
      • 1970-01-01
      • 1970-01-01
      • 2012-10-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多