Skip to content

Commit

Permalink
select all and unselect all
Browse files Browse the repository at this point in the history
  • Loading branch information
pxpm committed Jul 15, 2024
1 parent a52589f commit d8b87e9
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/resources/views/crud/fields/checklist.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,16 @@

@include('crud::fields.inc.wrapper_start')

<label>{!! $field['label'] !!}</label>
<label>{!! $field['label'] !!}

@if($field['show_select_all'] ?? false)
<div class="row checklist-select-all-inputs">
<span class="fs-6 small checklist-select-all-inputs">
<a href="javascript:void(0)" href="#" class="select-all-inputs">{{trans('backpack::crud.select_all')}}</a>
<a href="javascript:void(0)" href="#" class="unselect-all-inputs d-none">{{trans('backpack::crud.unselect_all')}}</a>
</div>
</span>
@endif
</label>

@include('crud::fields.inc.translatable_icon')

<input type="hidden" data-show-select-all="{{var_export($field['show_select_all'])}}" value='@json($field['value'])' name="{{ $field['name'] }}">
Expand Down Expand Up @@ -75,8 +78,8 @@ function bpFieldInitChecklist(element) {
let container = element.find('.row.checklist-options-container');
let checkboxes = container.find(':input[type=checkbox]');
let showSelectAll = hidden_input.data('show-select-all');
let selectAllAnchor = element.find('.row.checklist-select-all-inputs').find('a.select-all-inputs');
let unselectAllAnchor = element.find('.row.checklist-select-all-inputs').find('a.unselect-all-inputs');
let selectAllAnchor = element.find('.checklist-select-all-inputs').find('a.select-all-inputs');
let unselectAllAnchor = element.find('.checklist-select-all-inputs').find('a.unselect-all-inputs');
// set the default checked/unchecked states on checklist options
checkboxes.each(function(key, option) {
Expand Down

0 comments on commit d8b87e9

Please sign in to comment.