895d87f8fe1d1bfc4b703836cc46f0cff28a596c.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <div class="dropdown pull-right column-selector">
  2. <button type="button" class="btn btn-sm btn-instagram dropdown-toggle" data-toggle="dropdown">
  3. <i class="fa fa-table"></i>
  4. &nbsp;
  5. <span class="caret"></span>
  6. </button>
  7. <ul class="dropdown-menu" role="menu">
  8. <li>
  9. <ul>
  10. <?php $__currentLoopData = $columns; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $label): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
  11. <?php
  12. if (empty($visible)) {
  13. $checked = 'checked';
  14. } else {
  15. $checked = in_array($key, $visible) ? 'checked' : '';
  16. }
  17. ?>
  18. <li class="checkbox icheck">
  19. <label>
  20. <input type="checkbox" class="column-select-item" value="<?php echo e($key, false); ?>" <?php echo e($checked, false); ?>/>&nbsp;&nbsp;&nbsp;<?php echo e($label, false); ?>
  21. </label>
  22. </li>
  23. <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
  24. </ul>
  25. </li>
  26. <li class="divider"></li>
  27. <li class="text-right">
  28. <button class="btn btn-sm btn-default column-select-all"><?php echo e(__('admin.all'), false); ?></button>&nbsp;&nbsp;
  29. <button class="btn btn-sm btn-primary column-select-submit"><?php echo e(__('admin.submit'), false); ?></button>
  30. </li>
  31. </ul>
  32. </div>
  33. <style>
  34. .column-selector {
  35. margin-right: 10px;
  36. }
  37. .column-selector .dropdown-menu {
  38. padding: 10px;
  39. height: auto;
  40. max-height: 500px;
  41. overflow-x: hidden;
  42. }
  43. .column-selector .dropdown-menu ul {
  44. padding: 0;
  45. }
  46. .column-selector .dropdown-menu ul li {
  47. margin: 0;
  48. }
  49. .column-selector .dropdown-menu label {
  50. width: 100%;
  51. padding: 3px;
  52. }
  53. </style>
  54. <script>
  55. $('.column-select-submit').on('click', function () {
  56. var defaults = <?php echo json_encode($defaults, 15, 512) ?>;
  57. var selected = [];
  58. $('.column-select-item:checked').each(function () {
  59. selected.push($(this).val());
  60. });
  61. if (selected.length == 0) {
  62. return;
  63. }
  64. var url = new URL(location);
  65. if (selected.sort().toString() == defaults.sort().toString()) {
  66. url.searchParams.delete('_columns_');
  67. } else {
  68. url.searchParams.set('_columns_', selected.join());
  69. }
  70. $.pjax({container:'#pjax-container', url: url.toString()});
  71. });
  72. $('.column-select-all').on('click', function () {
  73. $('.column-select-item').iCheck('check');
  74. return false;
  75. });
  76. $('.column-select-item').iCheck({
  77. checkboxClass:'icheckbox_minimal-blue'
  78. });
  79. </script>
  80. <?php /**PATH C:\phpstudy_pro\WWW\cydsyy-api\vendor\encore\laravel-admin\src/../resources/views/components/grid-column-selector.blade.php ENDPATH**/ ?>