MVC之DataTableFor和Ajax链接

前端之家收集整理的这篇文章主要介绍了MVC之DataTableFor和Ajax链接前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
  1. @{
  2. ViewBag.Title = "基金主数据";
  3. }
  4.  
  5. <h2>@ViewBag.Title</h2>
  6.  
  7. <div class="listTitle">@Ajax.ModalDialogActionLink("新建基金...","New","Fund",null,"新建基金")</div>
  8.  
  9. <script type="text/javascript">
  10. var oTable;
  11.  
  12. function prepareServerParams(aoData) {
  13. $("#showDisabled").each(function() {
  14. aoData.push( { name: $(this).attr('id'),value: $(this).is(":checked") } );
  15. })
  16. }
  17. </script>
  18. @(Html.DataTableFor<FundListItem>("GetList","oTable","prepareServerParams"))
  19.  
  20. <input type="checkBox" id="showDisabled" name="showDisabled" value="false" onclick="oTable.fnDraw()" />
  21. @Html.Label("showDisabled","显示禁用的基金",new { @class="checkBox",onClick="oTable.fnDraw()" })
  22.  
  23. ----------------------
  24.  
  25. @if (ViewData.Model.IsDisabled)
  26. {
  27. @Html.ActionLink("启用","ToggleIsDisabled",new { Code = ViewData.Model.Code })
  28. }
  29. else
  30. {
  31. @Html.ActionLink("禁用",new { Code = ViewData.Model.Code })
  32. }

猜你在找的Ajax相关文章