Some datatables consistency
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<p>This system is aware of the following echoareas:</p>
|
||||
<p>This system is aware of the following echoareas @can('admin',(new \App\Models\Echoarea))(you can <a href="{{ url('ftn/echoarea/addedit') }}">add</a> more)@endcan:</p>
|
||||
|
||||
@if (\App\Models\Echoarea::count() == 0)
|
||||
@can('admin',(new \App\Models\Echoarea))
|
||||
@@ -23,7 +23,7 @@
|
||||
<p class="pad">There are no echoareas - you need to ask an admin to create one for you.</p>
|
||||
@endcan
|
||||
@else
|
||||
<table class="table monotable">
|
||||
<table class="table monotable" id="echoarea">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
@@ -35,11 +35,6 @@
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@can('admin',(new \App\Models\Echoarea))
|
||||
<tr>
|
||||
<td colspan="5"><a href="{{ url('ftn/echoarea/addedit') }}">Add New Echoarea</a></td>
|
||||
</tr>
|
||||
@endcan
|
||||
@foreach (\App\Models\Echoarea::orderBy('name')->with(['domain'])->get() as $oo)
|
||||
<tr>
|
||||
<td><a href="{{ url('ftn/echoarea/addedit',[$oo->id]) }}">{{ $oo->id }}</a></td>
|
||||
@@ -57,12 +52,48 @@
|
||||
@endsection
|
||||
|
||||
@section('page-scripts')
|
||||
<script type="text/javascript">
|
||||
$('table tr').click(function() {
|
||||
var href = $(this).find('a').attr('href');
|
||||
<link type="text/css" rel="stylesheet" href="https://cdn.datatables.net/1.10.25/css/dataTables.bootstrap5.min.css" media="screen">
|
||||
<link type="text/css" rel="stylesheet" href="{{ asset('plugin/dataTables/dataTables.bootstrap5.css') }}" media="screen">
|
||||
|
||||
if (href)
|
||||
window.location = href;
|
||||
<script type="text/javascript" src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdn.datatables.net/rowgroup/1.1.2/js/dataTables.rowGroup.min.js"></script>
|
||||
<script type="text/javascript" src="{{ asset('plugin/dataTables/dataTables.conditionalPaging.js') }}"></script>
|
||||
<script type="text/javascript" src="https://cdn.datatables.net/1.10.25/js/dataTables.bootstrap5.min.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('table tr').click(function() {
|
||||
var href = $(this).find('a').attr('href');
|
||||
|
||||
if (href)
|
||||
window.location = href;
|
||||
});
|
||||
|
||||
$('#echoarea').DataTable({
|
||||
paging: true,
|
||||
pageLength: 25,
|
||||
searching: true,
|
||||
order: [],
|
||||
conditionalPaging: {
|
||||
style: 'fade',
|
||||
speed: 500
|
||||
},
|
||||
rowGroup: {
|
||||
dataSrc: [4],
|
||||
},
|
||||
columnDefs: [
|
||||
{
|
||||
targets: [4],
|
||||
visible: false,
|
||||
},
|
||||
],
|
||||
language: {
|
||||
paginate: {
|
||||
previous: '<<',
|
||||
next: '>>'
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@append
|
||||
|
Reference in New Issue
Block a user