[英]How to use custom confirmation message with kendo ui grid destroy command?
[英]How to use Kendo grid custom command?
我正在使用Kendo UI Grid開發ASP.NET MVC4應用程序。
我想顯示“銷毀”命令的自定義確認消息。為此,我正在使用自定義命令。
以下是該代碼的一部分:
<%:Html.Kendo().Grid<Kendo.Mvc.Examples.Models.EmployeeViewModel>()
.Name("Grid")
.Columns(columns =>
{
columns.Bound(e => e.FirstName);
columns.Bound(e => e.LastName);
columns.Bound(e => e.Title);
columns.Command(command => command.Custom("ViewDetails").Click("showDetails"));
})
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("CustomCommand_Read", "Grid"))
)
%>
現在,我想在調用“ ShowDetails” javascript函數(自定義命令onclick函數)之前在DataSource中添加一個方法。
那么,如何在“數據源”部分中添加我的操作,例如-Read,Create,Destory?
你可以嘗試做
.Read(read => read.Action("CustomCommand_Read", "Grid").Data("JS_function"))
在這種情況下,您調用函數JS_function並傳遞參數,該參數將使您將此函數返回到控制器操作中(不要偽造添加到CustomCommand_Read參數中)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.