Excel button in datatables

This commit is contained in:
Juan Pablo Vial
2024-02-27 16:49:39 -03:00
parent dc7a9f9e7a
commit 370b6714bc
5 changed files with 36 additions and 9 deletions

View File

@ -136,7 +136,10 @@
</table>
@endsection
@include('layout.head.styles.datatables')
@include('layout.head.styles.datatables.buttons')
@include('layout.body.scripts.datatables')
@include('layout.body.scripts.datatables.buttons')
@push('page_scripts')
<script type="text/javascript">
@ -210,11 +213,6 @@
return
}
updateRow({pago_id: json.pago_id, fecha: json.fecha, estado: 'Anulado', color: 'red', remove_fecha: true, disable: true})
/*const tr = $("button[data-id='" + json.pago_id + "']").parent().parent()
tr.addClass('disabled')
tr.find(':nth-child(7)').addClass('red').html('Anulado')
tr.find(':nth-child(8)').html(json.fecha)
tr.find(':nth-child(9)').html('')*/
})
})
}
@ -296,7 +294,23 @@
order: [
[0, 'asc'],
[2, 'asc']
]
],
layout: {
top2End: {
buttons: [
{
extend: 'excel',
className: 'green',
text: 'Exportar a Excel <i class="file excel icon"></i>',
title: 'Cuotas - {{$venta->proyecto()->descripcion}} - {{$venta->propiedad()->summary()}}',
download: 'open',
exportOptions: {
columns: ':visible'
}
}
]
}
}
})
})
</script>