【问题标题】:How to use custom confirmation message with kendo ui grid destroy command?如何将自定义确认消息与 kendo ui grid destroy 命令一起使用?
【发布时间】:2014-02-15 12:22:46
【问题描述】:

我正在使用 Kendo UI Grid 开发 ASP.NET MVC4 应用程序。

我想使用 Destroy 命令显示自定义确认消息,而不是通常的确认消息。

下面是这段代码:

@(Html.Kendo().Grid<Gts.Core.Dto.CategoryDto>().Columns(columns =>
       {columns.Command(command => { command.Destroy(); }).Width(70).HtmlAttributes(new {style = "text-align:right;padding:0px;" });
}).DataSource(dataSource => dataSource
        .Ajax()
        .Model(model => model.Id(p => p.CategoryID))
        .Read(read => read.Action("CategoryItemDetails", "Category", new { CategoryID = "#=CategoryID#", categoryId = "#=FKCategoryID#" }))
                        .Destroy(update => update.Action("CategoryDestroy", "Category"))
             )
            .Events(events => events.DataBound("dataBoundChild").Edit("dataBoundEdit").Remove("deleteCategoryChild").Save("datasourceChange")).ToClientTemplate()

我们该怎么做?

【问题讨论】:

    标签: asp.net-mvc-4 command kendo-grid destroy confirmation


    【解决方案1】:

    您可以创建一个自定义模板列,如下所示

    { command: { text: "Delete", click: deleteData }, title: "Delete", width: width7, menu: false }
    

    在 deleteData 函数中,您可以在确认框中显示自定义的用户友好消息。

    【讨论】:

      猜你喜欢
      • 2013-08-06
      • 1970-01-01
      • 1970-01-01
      • 2018-12-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多