mirror of
https://github.com/cp6/my-idlers.git
synced 2025-04-19 09:38:36 +00:00
Added Datatables to domain index for sorting and searching ability
This commit is contained in:
parent
29b0f2aed1
commit
946fe9b893
1 changed files with 20 additions and 1 deletions
|
@ -9,7 +9,7 @@
|
|||
<a href="{{ route('domains.create') }}" class="btn btn-primary mb-3">Add a domain</a>
|
||||
<x-response-alerts></x-response-alerts>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered">
|
||||
<table class="table table-bordered" id="domain-table">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th class="text-nowrap">Domain</th>
|
||||
|
@ -63,4 +63,23 @@
|
|||
<x-modal-delete-script>
|
||||
<x-slot name="uri">domains</x-slot>
|
||||
</x-modal-delete-script>
|
||||
|
||||
@section('scripts')
|
||||
<script>
|
||||
window.addEventListener('load', function () {
|
||||
$('#domain-table').DataTable({
|
||||
"pageLength": 15,
|
||||
"lengthMenu": [5, 10, 15, 25, 30, 50, 75, 100],
|
||||
"columnDefs": [
|
||||
{"orderable": false, "targets": [5]}
|
||||
],
|
||||
"initComplete": function () {
|
||||
$('.dataTables_length,.dataTables_filter').addClass('mb-2');
|
||||
$('.dataTables_paginate').addClass('mt-2');
|
||||
$('.dataTables_info').addClass('mt-2 text-muted ');
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
@endsection
|
||||
</x-app-layout>
|
||||
|
|
Loading…
Add table
Reference in a new issue