data-table.blade.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <div class="dcat-box custom-data-table dt-bootstrap4">
  2. @include('admin::grid.table-toolbar')
  3. {!! $grid->renderFilter() !!}
  4. {!! $grid->renderHeader() !!}
  5. <div class="table-responsive table-wrapper {{ $grid->option('table_collapse') ? 'table-collapse' : '' }}">
  6. <table class="custom-data-table dataTable {{ $grid->formatTableClass() }}" id="{{ $tableId }}">
  7. <thead>
  8. @if ($headers = $grid->getComplexHeaders())
  9. <tr>
  10. @foreach($headers as $header)
  11. {!! $header->render() !!}
  12. @endforeach
  13. </tr>
  14. @endif
  15. <tr>
  16. @foreach($grid->columns() as $column)
  17. <th {!! $column->formatTitleAttributes() !!}>{!! $column->getLabel() !!}{!! $column->renderHeader() !!}</th>
  18. @endforeach
  19. </tr>
  20. </thead>
  21. @if ($grid->hasQuickCreate())
  22. {!! $grid->renderQuickCreate() !!}
  23. @endif
  24. <tbody>
  25. @foreach($grid->rows() as $row)
  26. <tr {!! $row->rowAttributes() !!}>
  27. @foreach($grid->getColumnNames() as $name)
  28. <td {!! $row->columnAttributes($name) !!}>
  29. {!! $row->column($name) !!}
  30. </td>
  31. @endforeach
  32. </tr>
  33. @endforeach
  34. @if ($grid->rows()->isEmpty())
  35. <tr>
  36. <td colspan="{!! count($grid->getColumnNames()) !!}">
  37. <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>
  38. </td>
  39. </tr>
  40. @endif
  41. </tbody>
  42. </table>
  43. </div>
  44. {!! $grid->renderFooter() !!}
  45. @include('admin::grid.table-pagination')
  46. </div>