selectresource.blade.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <div class="input-group input-group-sm select-resource">
  2. <div class="input-group-prepend">
  3. <span class="input-group-text bg-white"><b>{!! $label !!}</b></span>
  4. </div>
  5. <div item="{{ $maxItem }}" class="{{ $id }} {!! $containerClass !!}" placeholder="{{$placeholder}}" name="{{$name}}">
  6. @if($maxItem > 2 || ! $maxItem)
  7. <span class="selection">
  8. <span class="select2-selection select2-selection--multiple" role="combobox" >
  9. <ul class="select2-selection__rendered"></ul>
  10. </span>
  11. </span>
  12. @endif
  13. </div>
  14. <input name="{{$name}}" type="hidden" />
  15. <div class="input-group-append">
  16. <div class="btn btn-{{$btnStyle}} btn-sm " id="{{$name}}-filter-select-source">
  17. &nbsp;<i class="feather icon-arrow-up"></i>&nbsp;
  18. </div>
  19. </div>
  20. </div>
  21. <script data-exec-on-popstate>
  22. Dcat.ready(function () {
  23. Dcat.ResourceSelector({
  24. title: '{!! trans('admin.choose') !!} {!! $label !!}',
  25. selector: '#{{$name}}-filter-select-source',
  26. column: "{!! $name !!}",
  27. source: '{!! $source !!}',
  28. maxItem: {!! (int)$maxItem !!},
  29. area: {!! $area !!},
  30. queryName: '{{ Dcat\Admin\IFrameGrid::QUERY_NAME }}',
  31. items: {!! $value !!},
  32. placeholder: '{{$placeholder ?: $label}}',
  33. showCloseButton: false,
  34. @if($maxItem > 2 || !$maxItem) displayerContainer: $('div[name="{!! $name !!}"] .select2-selection'), @endif
  35. });
  36. });
  37. </script>