_Table.cshtml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. @model ShwasherSys.Views.Shared.New.Table.TableViewModel
  2. <!-- TABLE @(Model.TableId) START-->
  3. @if (Model.HasBox)
  4. {
  5. <style>
  6. .table-box {
  7. text-decoration: none;
  8. }
  9. </style>
  10. @Html.Raw("<div class=\"table-box iwb-bootstrap-table\">")
  11. }
  12. @{
  13. if (Model.HasBox&&(Model.ActiveMenu != null|| Model.SearchForm != null))
  14. {
  15. @Html.Action("ToolMenu", "Layout", new { pageName = Model.ActiveMenu, searchForm = Model.SearchForm })
  16. }
  17. }
  18. @*data-content-type="application/x-www-form-urlencoded; charset=UTF-8"*@
  19. <table id="@(Model.TableId)"
  20. data-url="@(Model.Url)"
  21. data-striped="true" data-id-field="id" data-unique-id="id"
  22. data-method="post"
  23. data-side-pagination="server"
  24. data-cache="false"
  25. data-pagination="true"
  26. data-page-size="@(Model.PageArray[0])"
  27. data-page-number="1"
  28. data-page-list="[@(Model.PageArrayStr)]" data-pagination-detail-h-align="right" data-pagination-h-align="left"
  29. data-click-to-select="true"
  30. data-single-select="@(Model.SingleSelectStr)" @(Html.Raw(Model.Other))>
  31. <thead>
  32. <tr class="row">
  33. <th data-field="state" data-checkbox="true"></th>
  34. @if (Model.FieldItems != null && Model.FieldItems.Any())
  35. {
  36. foreach (var item in Model.FieldItems)
  37. {
  38. var formatter = string.IsNullOrEmpty(item.Formatter) ? "" : "data-formatter=\"" + item.Formatter + "\"";
  39. <th data-align="@(item.Align)" data-field="@(item.Filed)" @(Html.Raw(item.IsSortStr)) @(Html.Raw(formatter)) @(Html.Raw(item.IsTipStr)) @(Html.Raw(item.WidthStr))>@(item.DisplayName)</th>
  40. }
  41. }
  42. </tr>
  43. </thead>
  44. </table>
  45. @if (Model.HasBox)
  46. {
  47. @Html.Raw("</div>")
  48. }
  49. <!-- TABLE @(Model.TableId) END-->