_Table.cshtml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. @model ContractService.Views.Shared.Table.TableViewModel
  2. <!-- TABLE @(Model.TableId) START-->
  3. @if (Model.HasBox)
  4. {
  5. @Html.Raw("<div class=\"table-box iwb-bootstrap-table\">")
  6. }
  7. @{
  8. if (Model.HasBox && (Model.CurrentPage != null || Model.SearchForm != null))
  9. {
  10. <section class="table-box-header">
  11. <div class="container-fluid">
  12. @Html.Action("ToolMenu", "Layout", new { activeMenu = Model.CurrentPage, searchForm = Model.SearchForm })
  13. </div>
  14. </section>
  15. }
  16. }
  17. @*data-content-type="application/x-www-form-urlencoded; charset=UTF-8"*@
  18. <section class="table-box-content">
  19. <table id="@(Model.TableId)" class="table"
  20. data-url="@(Model.Url)"
  21. data-striped="true" data-id-field="@(Model.FieldId)" data-unique-id="@(Model.FieldId)"
  22. @(Html.Raw(Model.LocalDataStr))
  23. @*@(Html.Raw(Model.IsLocalData ? "" : "data-method=\"get\" data-side-pagination=\"server\""))*@
  24. data-cache="false"
  25. data-pagination="@(Model.PageStr)"
  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="@(Model.ClickSelectStr)"
  30. data-single-select="@(Model.SingleSelectStr)" @(Html.Raw(Model.Other))>
  31. <thead>
  32. <tr class="row">
  33. <th data-field="state" data-checkbox="true" data-width="50"></th>
  34. @if (Model.FieldItems != null && Model.FieldItems.Any())
  35. {
  36. foreach (var item in Model.FieldItems)
  37. {
  38. <th data-align="@(item.Align)" data-field="@(item.Filed)" @(Html.Raw(item.IsSortStr)) @(Html.Raw(item.FormatterStr)) @(Html.Raw(item.IsTipStr)) @(Html.Raw(item.WidthStr))>@(item.DisplayName)</th>
  39. }
  40. }
  41. </tr>
  42. </thead>
  43. </table>
  44. </section>
  45. @if (Model.HasBox)
  46. {
  47. @Html.Raw("</div>")
  48. }
  49. <!-- TABLE @(Model.TableId) END-->