checkbox.blade.php
1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
@extends('admin::grid.inline-edit.comm')
@section('field')
@foreach($options as $option => $label)
<div class="checkbox icheck">
<label>
<input type="checkbox" name='radio-{{ $name }}[]' class="minimal ie-input" value="{{ $option }}" data-label="{{ $label }}"/> {{$label}}
</label>
</div>
@endforeach
@endsection
@section('assert')
<style>
.icheck.checkbox {
margin: 5px 0 5px 20px;
}
.ie-content-{{ $name }} .ie-container {
width: 150px;
position: relative;
}
</style>
<script>
@component('admin::grid.inline-edit.partials.popover', compact('trigger'))
@slot('content')
$template.find('input[type=checkbox]').each(function (index, checkbox) {
if($.inArray($(checkbox).attr('value'), $trigger.data('value')) >= 0) {
$(checkbox).attr('checked', true);
}
});
@endslot
@endcomponent
</script>
<script>
@component('admin::grid.inline-edit.partials.submit', compact('resource', 'name'))
@slot('val')
var val = [];
var label = [];
$popover.find('.ie-input:checked').each(function(){
val.push($(this).val());
label.push($(this).data('label'));
});
@endslot
$popover.data('display').html(label.join(';'));
@endcomponent
</script>
@endsection