MVC之DataTableFor和Ajax链接
发布时间:2020-12-16 00:53:42 所属栏目:百科 来源:网络整理
导读:@{ ViewBag.Title = "基金主数据";}h2@ViewBag.Title/h2div class="listTitle"@Ajax.ModalDialogActionLink("新建基金...","New","Fund",null,"新建基金")/divscript type="text/javascript" var oTable; function prepareServerParams(aoData) { $("#showDi
@{ ViewBag.Title = "基金主数据"; } <h2>@ViewBag.Title</h2> <div class="listTitle">@Ajax.ModalDialogActionLink("新建基金...","New","Fund",null,"新建基金")</div> <script type="text/javascript"> var oTable; function prepareServerParams(aoData) { $("#showDisabled").each(function() { aoData.push( { name: $(this).attr('id'),value: $(this).is(":checked") } ); }) } </script> @(Html.DataTableFor<FundListItem>("GetList","oTable","prepareServerParams")) <input type="checkbox" id="showDisabled" name="showDisabled" value="false" onclick="oTable.fnDraw()" /> @Html.Label("showDisabled","显示禁用的基金",new { @class="checkbox",onClick="oTable.fnDraw()" }) ---------------------- @if (ViewData.Model.IsDisabled) { @Html.ActionLink("启用","ToggleIsDisabled",new { Code = ViewData.Model.Code }) } else { @Html.ActionLink("禁用",new { Code = ViewData.Model.Code }) } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |