为什么click事件在KendoUI Grid中不起作用

时间:2013-01-18 04:58:01

标签: asp.net-mvc-3 asp.net-mvc-4 kendo-ui telerik-mvc kendo-grid

当我点击KendoUI中的按钮时,点击功能不起作用EditfunctionDeletefunction

<%: 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>

1 个答案:

答案 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");
    })