我已经获得
@grid.GetHtml(
tableStyle: "grid",
headerStyle: "head",
alternatingRowStyle: "alt",
rowStyle: "row",
selectedRowStyle: "selected-row",
columns: grid.Columns(
grid.Column("StartDate", "Start Date", style: "column"),
grid.Column("EndDate", "Endt Date", style: "column"),
grid.Column("Title", "Title", style: "column"),
grid.Column(format: (item) => Html.ActionLink("Edit", "Edit", new { id = item.ID }), style: "column-action"),
grid.Column(format: (item) => Html.ActionLink("Delete", "Delete", new { id = item.ID }), style: "column-action"))
我想做的是将
grid.Column(format: (item) => Html.ActionLink("Delete", "Delete", new { id = item.ID }), style: "column-action")
替换为:<button onclick="$.prompt('Delete',{ buttons: { Ok: true, Cancel: false } })" title="Delete">Delete</button>
我该如何做到这一点?
P.S. 最终目标是在单击“删除”按钮时显示弹出窗口,让用户选择是或否。
$(".delete-button").click(function() ...
。 - Rory McCrossan