mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Generados botones de exportar a excel en listado facturas (no logica
This commit is contained in:
@ -78,11 +78,60 @@
|
|||||||
pageLength: 250,
|
pageLength: 250,
|
||||||
lengthChange: true,
|
lengthChange: true,
|
||||||
"dom": 'lfBrtip',
|
"dom": 'lfBrtip',
|
||||||
"buttons": [
|
buttons: [
|
||||||
'copy', 'csv', 'excel', 'print', {
|
{
|
||||||
extend: 'pdfHtml5',
|
text: 'Exportar Excel Contaplus',
|
||||||
orientation: 'landscape',
|
action: function (e, dt, button, config) {
|
||||||
pageSize: 'A4'
|
var searchValue = theTable.search(); // Captura el valor del campo de búsqueda
|
||||||
|
var ajaxParams = theTable.ajax.params(); // Captura otros parámetros de la tabla
|
||||||
|
|
||||||
|
console.log(searchValue);
|
||||||
|
|
||||||
|
/*
|
||||||
|
$.ajax({
|
||||||
|
url: '/ruta/exportarExcel', // URL del servidor para manejar la exportación
|
||||||
|
type: 'POST',
|
||||||
|
data: {
|
||||||
|
search: searchValue,
|
||||||
|
extraParams: ajaxParams
|
||||||
|
},
|
||||||
|
xhrFields: {
|
||||||
|
responseType: 'blob' // Para manejar la descarga del archivo
|
||||||
|
},
|
||||||
|
success: function(blob, status, xhr) {
|
||||||
|
// Crear un enlace temporal para descargar el archivo
|
||||||
|
var link = document.createElement('a');
|
||||||
|
var url = window.URL.createObjectURL(blob);
|
||||||
|
link.href = url;
|
||||||
|
link.download = 'datos_personalizados.xlsx';
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
document.body.removeChild(link);
|
||||||
|
window.URL.revokeObjectURL(url);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Exportar Lineas a Excel',
|
||||||
|
action: function (e, dt, button, config) {
|
||||||
|
var searchValue = theTable.search(); // Captura el valor del campo de búsqueda
|
||||||
|
var ajaxParams = theTable.ajax.params(); // Captura otros parámetros de la tabla
|
||||||
|
|
||||||
|
console.log(searchValue);
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Exportar Girosgit ',
|
||||||
|
action: function (e, dt, button, config) {
|
||||||
|
var searchValue = theTable.search(); // Captura el valor del campo de búsqueda
|
||||||
|
var ajaxParams = theTable.ajax.params(); // Captura otros parámetros de la tabla
|
||||||
|
|
||||||
|
console.log(searchValue);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
stateSave: true,
|
stateSave: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user