如何更改Kendo UI网格上的文本销毁或删除命令操作?

时间:2021-06-25 01:16:42

I'm using a KendoUI KendoGrid. I have a column with delete button or "destroy" action. Kendo displays an alert box with the text "Are you sure you want to delete this record?" I need this text to be more specific to my situation. How do you customize this text?

我用的是肯德尔KendoGrid。我有一个带有删除按钮或“销毁”操作的列。Kendo显示了一个带有文本的警告框“您确定要删除此记录吗?”我需要这篇文章更具体地说明我的情况。如何自定义此文本?

Any help would be appreciated.

如有任何帮助,我们将不胜感激。

My code for adding the columns is:

我添加列的代码是:

$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,

3 个解决方案

#1


9  

according to the Kendo Grid documentation:

根据Kendo网格文件:

editable.confirmation Boolean | String

可编辑的。确认布尔|字符串

Defines the text that will be used in confirmation box when delete an item.

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

#2


24  

If you are using Kendo UI for ASP.NET MVC you can use DisplayDeleteConfirmation

如果您正在使用Kendo UI来实现ASP。NET MVC可以使用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");
                  }))

#3


2  

Replace

取代

editable: "inline"

with

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

#1


9  

according to the Kendo Grid documentation:

根据Kendo网格文件:

editable.confirmation Boolean | String

可编辑的。确认布尔|字符串

Defines the text that will be used in confirmation box when delete an item.

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

#2


24  

If you are using Kendo UI for ASP.NET MVC you can use DisplayDeleteConfirmation

如果您正在使用Kendo UI来实现ASP。NET MVC可以使用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");
                  }))

#3


2  

Replace

取代

editable: "inline"

with

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