fixed-table.blade.php 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <div class="dcat-box custom-data-table dt-bootstrap4">
  2. @if ($grid->allowToolbar())
  3. <div class="custom-data-table-header">
  4. <div class="table-responsive">
  5. <div class="top d-block clearfix p-0">
  6. @if(!empty($title))
  7. <h4 class="pull-left" style="margin:5px 10px 0;">
  8. {!! $title !!}&nbsp;
  9. @if(!empty($description))
  10. <small>{!! $description!!}</small>
  11. @endif
  12. </h4>
  13. <div class="pull-right" data-responsive-table-toolbar="{{$tableId}}">
  14. {!! $grid->renderTools() !!} {!! $grid->renderCreateButton() !!} {!! $grid->renderExportButton() !!} {!! $grid->renderQuickSearch() !!}
  15. </div>
  16. @else
  17. {!! $grid->renderTools() !!} {!! $grid->renderQuickSearch() !!}
  18. <div class="pull-right" data-responsive-table-toolbar="{{$tableId}}">
  19. {!! $grid->renderCreateButton() !!} {!! $grid->renderExportButton() !!}
  20. </div>
  21. @endif
  22. </div>
  23. </div>
  24. </div>
  25. @endif
  26. {!! $grid->renderFilter() !!}
  27. {!! $grid->renderHeader() !!}
  28. <div class="table-responsive table-wrapper">
  29. <div class="tables-container">
  30. <div class="table-wrap table-main">
  31. <table class="custom-data-table dataTable {{ $grid->formatTableClass() }}" id="{{ $tableId }}">
  32. <thead>
  33. @if ($headers = $grid->getComplexHeaders())
  34. <tr>
  35. @foreach($headers as $header)
  36. {!! $header->render() !!}
  37. @endforeach
  38. </tr>
  39. @endif
  40. <tr>
  41. @foreach($grid->columns() as $column)
  42. <th {!! $column->formatTitleAttributes() !!}>{!! $column->getLabel() !!}{!! $column->renderHeader() !!}</th>
  43. @endforeach
  44. </tr>
  45. </thead>
  46. @if ($grid->hasQuickCreate())
  47. {!! $grid->renderQuickCreate() !!}
  48. @endif
  49. <tbody>
  50. @foreach($grid->rows() as $row)
  51. <tr {!! $row->rowAttributes() !!}>
  52. @foreach($grid->getColumnNames() as $name)
  53. <td {!! $row->columnAttributes($name) !!}>
  54. {!! $row->column($name) !!}
  55. </td>
  56. @endforeach
  57. </tr>
  58. @endforeach
  59. @if ($grid->rows()->isEmpty())
  60. <tr>
  61. <td colspan="{!! count($grid->getColumnNames()) !!}">
  62. <div style="margin:5px 0 0 10px;"><span class="help-block" style="margin-bottom:0"><i class="feather icon-alert-circle"></i>&nbsp;{{ trans('admin.no_data') }}</span></div>
  63. </td>
  64. </tr>
  65. @endif
  66. </tbody>
  67. </table>
  68. </div>
  69. @if($grid->leftVisibleColumns()->isNotEmpty())
  70. <div class="table-wrap table-fixed table-fixed-left">
  71. <table class="custom-data-table dataTable {{ $grid->formatTableClass() }} ">
  72. <thead>
  73. <tr>
  74. @foreach($grid->leftVisibleColumns() as $column)
  75. <th {!! $column->formatTitleAttributes() !!}>{!! $column->getLabel() !!}{!! $column->renderHeader() !!}</th>
  76. @endforeach
  77. </tr>
  78. </thead>
  79. <tbody>
  80. @foreach($grid->rows() as $row)
  81. <tr {!! $row->rowAttributes() !!}>
  82. @foreach($grid->leftVisibleColumns() as $column)
  83. <td {!! $row->columnAttributes($column->getName()) !!}>
  84. {!! $row->column($column->getName()) !!}
  85. </td>
  86. @endforeach
  87. </tr>
  88. @endforeach
  89. </tbody>
  90. </table>
  91. </div>
  92. @endif
  93. @if($grid->rightVisibleColumns()->isNotEmpty())
  94. <div class="table-wrap table-fixed table-fixed-right">
  95. <table class="custom-data-table dataTable {{ $grid->formatTableClass() }} ">
  96. <thead>
  97. <tr>
  98. @foreach($grid->rightVisibleColumns() as $column)
  99. <th {!! $column->formatTitleAttributes() !!}>{!! $column->getLabel() !!}{!! $column->renderHeader() !!}</th>
  100. @endforeach
  101. </tr>
  102. </thead>
  103. <tbody>
  104. @foreach($grid->rows() as $row)
  105. <tr {!! $row->rowAttributes() !!}>
  106. @foreach($grid->rightVisibleColumns() as $column)
  107. <td {!! $row->columnAttributes($column->getName()) !!}>
  108. {!! $row->column($column->getName()) !!}
  109. </td>
  110. @endforeach
  111. </tr>
  112. @endforeach
  113. </tbody>
  114. </table>
  115. </div>
  116. @endif
  117. </div>
  118. </div>
  119. {!! $grid->renderFooter() !!}
  120. @if ($paginator = $grid->paginator())
  121. <div class="box-footer clearfix " style="padding-bottom:5px;">
  122. {!! $paginator->render() !!}
  123. </div>
  124. @else
  125. <div class="box-footer clearfix text-80 " style="height:48px;line-height:25px;">
  126. @if ($grid->rows()->isEmpty())
  127. {!! trans('admin.pagination.range', ['first' => '<b>0</b>', 'last' => '<b>'.$grid->rows()->count().'</b>', 'total' => '<b>'.$grid->rows()->count().'</b>',]) !!}
  128. @else
  129. {!! trans('admin.pagination.range', ['first' => '<b>1</b>', 'last' => '<b>'.$grid->rows()->count().'</b>', 'total' => '<b>'.$grid->rows()->count().'</b>',]) !!}
  130. @endif
  131. </div>
  132. @endif
  133. </div>