Skip to content

Commit 31b72fc

Browse files
committed
Listing column save visibility
1 parent 819f226 commit 31b72fc

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

resources/views/la/modules/show.blade.php

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,14 @@
117117
<td>{{ $field['minlength'] }}</td>
118118
<td>{{ $field['maxlength'] }}</td>
119119
<td>@if($field['required']) <span class="text-danger">True</span>@endif </td>
120-
<td>@if($field['listing_col']) <span class="text-danger">True</span>@endif </td>
120+
<td>
121+
<form id="listing_view_cal" action="{{ url(config('laraadmin.adminRoute') . '/module_field_listing_show') }}">
122+
<input name="ref_{!! $field['id'] !!}" type="checkbox" @if($field['listing_col'] == 1) checked="checked" @endif>
123+
<div class="Switch Ajax Round @if($field['listing_col'] == 1) On @else Off @endif" listid="{{ $field['id'] }}">
124+
<div class="Toggle"></div>
125+
</div>
126+
</form>
127+
</td>
121128
<td style="max-width:300px;"><?php echo LAHelper::parseValues($field['popup_vals']) ?></td>
122129
<td style="min-width:60px;">
123130
<a href="{{ url(config('laraadmin.adminRoute') . '/module_fields/'.$field['id'].'/edit') }}" class="btn btn-edit-field btn-warning btn-xs" style="display:inline;padding:2px 5px 3px 5px;" id="edit_{{ $field['colname'] }}"><i class="fa fa-edit"></i></a>
@@ -691,6 +698,27 @@ function showValuesTypes() {
691698
$icon.addClass('fa-chevron-down');
692699
}
693700
});
701+
702+
$('.Switch.Ajax').click(function() {
703+
var state = "false";
704+
if ($(this).hasClass('On')) {
705+
state = "false";
706+
} else {
707+
state = "true";
708+
}
709+
$.ajax({
710+
type: "POST",
711+
url : "{{ url(config('laraadmin.adminRoute') . '/module_field_listing_show') }}",
712+
data : {
713+
_token: '{{ csrf_token() }}',
714+
listid: $(this).attr("listid"),
715+
state: state,
716+
},
717+
success : function(data){
718+
console.log(data);
719+
}
720+
});
721+
});
694722
});
695723
</script>
696724
@endpush

0 commit comments

Comments
 (0)