_Table.cshtml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. @model WeApp.Views.Shared.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 { activeMenu = 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. @(Html.Raw(Model.LocalDataStr))
  23. data-cache="false"
  24. data-pagination="true"
  25. data-page-size="@(Model.PageArray[0])"
  26. data-page-number="1"
  27. data-page-list="[@(Model.PageArrayStr)]" data-pagination-detail-h-align="right" data-pagination-h-align="left"
  28. data-click-to-select="true"
  29. data-single-select="@(Model.SingleSelectStr)" @(Html.Raw(Model.Other))>
  30. <thead>
  31. <tr class="row">
  32. <th data-field="state" data-checkbox="true"></th>
  33. @if (Model.FieldItems != null && Model.FieldItems.Any())
  34. {
  35. foreach (var item in Model.FieldItems)
  36. {
  37. var formatter = string.IsNullOrEmpty(item.Formatter) ? "" : "data-formatter=\"" + item.Formatter + "\"";
  38. <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>
  39. }
  40. }
  41. </tr>
  42. </thead>
  43. </table>
  44. @if (Model.HasBox)
  45. {
  46. @Html.Raw("</div>")
  47. }
  48. <!-- TABLE @(Model.TableId) END-->