+
+
+ @component('components.card')
+ @include('components.datatable', ['route' => route('Shop.Admin.ArticleAttributeFamilies.index'), 'model' => 'ArticleAttributeFamilies'])
+ @endcomponent
+
+
+
+ @component('components.card')
+ @include('components.datatable', ['route' => route('Shop.Admin.ArticleAttributeValues.index'), 'model' => 'ArticleAttributeValues'])
+ @endcomponent
+
+
+
+
+
+@endsection
diff --git a/resources/views/Shop/Admin/ArticleAttributeValues/list.blade.php b/resources/views/Shop/Admin/ArticleAttributeValues/list.blade.php
index 4a189a34..b3e1f1f5 100644
--- a/resources/views/Shop/Admin/ArticleAttributeValues/list.blade.php
+++ b/resources/views/Shop/Admin/ArticleAttributeValues/list.blade.php
@@ -14,7 +14,3 @@
@endcomponent
@endsection
-
-@push('scripts')
- @include('components.js.datatable', ['route' => route('Shop.Admin.ArticleAttributeValues.index'), 'model' => 'articleattributevalues'])
-@endpush
\ No newline at end of file
diff --git a/resources/views/components/datatable.blade.php b/resources/views/components/datatable.blade.php
index 0b66b12d..cea926e2 100644
--- a/resources/views/components/datatable.blade.php
+++ b/resources/views/components/datatable.blade.php
@@ -1,13 +1,10 @@
+@include('load.datatables')
+
@include('components.datatables.header')
{{$dataTable->table(['class'=>'table table-bordered table-hover table-striped w-100 mb-0'])}}
-@push('css')
-
@include('components.datatables.buttons.print')
- @include('components.datatables.buttons.download')
+
+ @if (isset($with_exports) && $with_exports)
+ @include('components.datatables.buttons.download')
+ @endif
diff --git a/resources/views/components/datatables/buttons/print.blade.php b/resources/views/components/datatables/buttons/print.blade.php
index 893ee7f7..404c7921 100644
--- a/resources/views/components/datatables/buttons/print.blade.php
+++ b/resources/views/components/datatables/buttons/print.blade.php
@@ -4,8 +4,8 @@
@@ -16,6 +16,12 @@
var table = window.LaravelDataTables["{{ $model }}-table"];
table.button(1).trigger();
});
+
+ $('.printWithFilter').click(function() {
+ var data = $('#filters').serialize();
+ var url = "{{ $route }}/print?" + data;
+ window.location = url;
+ })
@endpush
diff --git a/resources/views/components/datatables/search.blade.php b/resources/views/components/datatables/search.blade.php
index b3cfc872..2c44e2f2 100644
--- a/resources/views/components/datatables/search.blade.php
+++ b/resources/views/components/datatables/search.blade.php
@@ -3,11 +3,17 @@
@include('components.datatables.buttons.pageLength')
- @include('components.datatables.buttons.filters')
- @include('components.datatables.buttons.colvis')
-
+
+ @if (isset($with_filters) && $with_filters)
+ @include('components.datatables.buttons.filters')
+ @endif
+ @if (isset($with_colvis) && $with_colvis)
+ @include('components.datatables.buttons.colvis')
+ @endif
+
+ @endif
@push('js')
@@ -15,7 +21,7 @@
var $search = $('#{{ $model }}-table-header .search-btn');
$search.on( 'keyup click', function () {
var table = window.LaravelDataTables["{{ $model }}-table"];
- table.search($search.val()).draw();
- } );
+ table.search($search.val()).draw();
+ } );
@endpush
\ No newline at end of file
diff --git a/resources/views/components/js/datatable.blade.php b/resources/views/components/js/datatable.blade.php
index 113d9af0..66db9c08 100644
--- a/resources/views/components/js/datatable.blade.php
+++ b/resources/views/components/js/datatable.blade.php
@@ -1,11 +1,3 @@
-
-
{{$dataTable->scripts()}}
-
-
@stack('scripts')
+
+
+
+
+ @endpush
+
+ @php(define('LOAD_DATATABLES', true))
+
+@endif
\ No newline at end of file