file-management-system/resources/views/pages/users/role/_table.blade.php

51 lines
1.4 KiB
PHP
Raw Normal View History

<!--begin::Table-->
{{ $dataTable->table() }}
<!--end::Table-->
{{-- Inject Scripts --}}
@section('scripts')
{{ $dataTable->scripts() }}
@endsection
@push('customscript')
<script>
$("#searchbox").on("keyup search input paste cut", function() {
LaravelDataTables["roles-table"].search(this.value).draw();
});
$(function(){
LaravelDataTables["roles-table"].on('click','.delete',function(event){
var form = $(this).closest("form");
event.preventDefault();
Swal.fire({
title: 'Are you sure?',
text: "You won't be able to revert this!",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, delete it!'
}).then((result) => {
if (result.isConfirmed) {
form.submit();
Swal.fire(
'Deleted!',
'Your file has been deleted.',
'success'
)
}
})
})
})
</script>
@endpush
@section('styles')
<style>
.dataTables_filter {
display: none;
}
</style>
@endsection