如何更改Kendo UI Grid上的文本销毁或删除命令操作?
我正在使用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,
根据Kendo Grid文档 :
editable.confirmation布尔| 串
定义删除项目时将在确认框中使用的文本。
如果您使用Kendo UI for ASP.NET MVC,则可以使用DisplayDeleteConfirmation
@(Html.Kendo().Grid() .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"); }))
更换
editable: "inline"
同
editable: { confirmation: "Your custom message", mode: "inline" },