28 lines
850 B
PHP
28 lines
850 B
PHP
<span>
|
|
<button type="button" class="btn bg-gradient-secondary dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
|
|
<i class="fa fa-print"></i>
|
|
</button>
|
|
|
|
<ul class="dropdown-menu" x-placement="bottom-start">
|
|
<li class="dropdown-item printWithFilter"><a href="#" target="_BLANK">Imprimer la sélection</a></li>
|
|
<li class="dropdown-item"><a href="{{ $route }}/print" target="_BLANK">Imprimer la liste complète</a></li>
|
|
</ul>
|
|
</span>
|
|
|
|
@push('js')
|
|
<script>
|
|
var $print = $('#{{ $model }}-table-header .btn-print');
|
|
$print.on( 'click', function () {
|
|
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;
|
|
})
|
|
</script>
|
|
@endpush
|
|
|