本文介绍了Telerik网格模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<script type="text/javascript">
    $(document).ready(function () {
        $(".DeleteButton").click(function () {
            var flag = window.confirm("?");
            var deleteid = $(this).attr("deleteid");
            if (flag == true) {
                $.post("/Biography/Delete", { id: deleteid }, function (data) {
                    $("#content").html(data);
                });
            }
        });

        $(".EditButton").click(function () {
            var editid = $(this).attr("editid");
            $.get("/Biography/Edit", { id: editid }, function (data) {
                $("#content").html(data);
            });
        });
</script>







.Columns(columns =>
                     {
                         columns.Bound(b => b.ID);
                         columns.Bound(b => b.Name);
                         columns.Bound(b => b.Sex);
                         columns.Bound(b => b.Department);
                         columns.Bound(b => b.Post);
                         columns.Bound(b => b.Degree);
                         columns.Template(b => @Html.Raw("<input class='DeleteButton' type='button' value='Delete' deleteid='" + b.ID + "'/>"
                                        + "<input class='EditButton' type='button' value='Edit' editid='" + b.ID + "'/>"))
                                         .ClientTemplate("<input class='DeleteButton' type='button' value='Delete' deleteid='<#= ID #>'/>"
                                        + "<input class='EditButton' type='button' value='Edit' editid='<#= ID #>'/>");
                     })


当页面或之后筛选时,该按钮被禁用.


When page or filter after,the button is disabled.

推荐答案




这篇关于Telerik网格模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-18 03:25