当我点击KendoUI中的按钮时,点击功能不起作用Editfunction
和Deletefunction
。
<%: Html.Kendo().Grid(gridobj)
.Name("Grid")
.Columns(columns =>
{
columns.Bound(p => p.TMovie_id).Groupable(false).Title("ID");
columns.Bound(p => p.Name).Title("Name");
columns.Bound(p => p.Genre).Title("Genre");
columns.Command(command => command.Custom("Edit").Click("Editfunction"));
columns.Command(command => command.Custom("Delete").Click("Deletefunction"));
})
.Groupable()
.Pageable()
.Sortable()
.Scrollable()
.Filterable()
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("", ""))
)
%>
<script type="text/javascript">
function Editfunction(e) {
e.alert("Inside e Hi");
alert("hi");
}
function Deletefunction(e) {
e.alert("Inside e Hi");
alert("hi");
}
</script>
答案 0 :(得分:0)
columns.Command(commands =>
{
commands.Custom("Edit").Click("Editfunction");
command.Custom("Delete").Click("Deletefunction");
})
或
columns.Command(commands =>
{
commands.Destroy().Text("delete");
commands.Edit().Text("edite");
})