<span>
	<button type="button" class="btn bg-gradient-secondary dropdown-toggle btn-excel" data-toggle="dropdown" aria-expanded="false">
		<i class="fa fa-fw fa-download"></i>
	</button>

	<ul class="dropdown-menu" x-placement="bottom-start">
		<li class="dropdown-item"><a href="#" class="excelWithFilter"><i class="fa fa-file-excel"></i> Exporter la sélection</a></li>
		<li class="dropdown-item"><a href="{{ $route }}/exportExcel"><i class="fa fa-file-excel"></i> Exporter la liste complète</a></li>
		<div class="dropdown-divider"></div>
		<li class="dropdown-item"><a href="#" class="pdfWithFilter"><i class="fa fa-file-pdf"></i> Exporter la sélection</a></li>
		<li class="dropdown-item"><a href="{{ $route }}/exportPDF"><i class="fa fa-file-pdf"></i> Exporter la liste complète</a></li>
	</ul>
</span>

@push('js')
	<script>
		$('.excelWithFilter').click(function() {
			var data = $('#filters').serialize();
			var url = "{{ $route }}/exportExcel?" + data;
			window.location = url;
		})
		$('.pdfWithFilter').click(function() {
			var data = $('#filters').serialize();
			var url = "{{ $route }}/exportPDF?" + data;
			window.location = url;
		})
	</script>
@endpush
