Soy nuevo trabajando con Angular UI-GRID y necesito crear botones externos para las funciones de exportación como la exportación de PDF. He leído la documentación y descubrí que puedo usar la biblioteca PDFMake para crear un encabezado complejo a través de la documentación que no encontré. cualquier ejemplo para resolver mi problema.
Por favor mira la imagen y ayúdame. ¿Cómo puedo combinar ambas características?
var docDefinition = { content: [ { layout: 'lightHorizontalLines', // optional table: { // headers are automatically repeated if the table spans over multiple pages // you can declare how many rows should be treated as headers headerRows: 1, widths: ['*', 'auto', 100, '*'], body: [ ['First', 'Second', 'Third', 'The last one'], ['Value 1', 'Value 2', 'Value 3', 'Value 4'], [{ text: 'Bold value', bold: true }, 'Val 2', 'Val 3', 'Val 4'] ] } } ] }; // #region export data pdfMake.createPdf(docDefinition).open(); // #endregion // with this I can export pdf with table var grid = $scope.gridApi.grid; var rowTypes = uiGridExporterConstants.ALL; var colTypes = uiGridExporterConstants.ALL; uiGridExporterService.pdfExport(grid, rowTypes, colTypes); //With this I can export my grid but without header.Se puede hacer usando la función de encabezado y agregando una tabla en ella:
header: function() { return { table: { // Add your table data here }, }; },