File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 247
247
* @propertyOf ui.grid.exporter.api:GridOptions
248
248
* @description The default filename to use when saving the downloaded pdf, only used in IE (other browsers open pdfs in a new window)
249
249
* <br/>Defaults to 'download.pdf'
250
+ * <pre>
251
+ * gridOptions.exporterPdfFilename = "rows.pdf"
252
+ * </pre>
253
+ * <br/>Or a function returning a string:
254
+ * <pre>
255
+ * gridOptions.exporterPdfFilename = function(grid, rowTypes, colTypes) { return "rows" + rowTypes + ".pdf" };
256
+ * </pre>
250
257
*/
251
258
gridOptions . exporterPdfFilename = gridOptions . exporterPdfFilename ? gridOptions . exporterPdfFilename : 'download.pdf' ;
252
259
/**
1276
1283
docDefinition = self . prepareAsPdf ( grid , exportColumnHeaders , exportData ) ;
1277
1284
1278
1285
if ( self . isIE ( ) || navigator . appVersion . indexOf ( 'Edge' ) !== - 1 ) {
1279
- self . downloadPDF ( grid . options . exporterPdfFilename , docDefinition ) ;
1286
+ var fileName = angular . isFunction ( grid . options . exporterPdfFilename ) ? grid . options . exporterPdfFilename ( grid , rowTypes , colTypes ) : grid . options . exporterPdfFilename ;
1287
+ self . downloadPDF ( fileName , docDefinition ) ;
1280
1288
} else {
1281
1289
pdfMake . createPdf ( docDefinition ) . open ( ) ;
1282
1290
}
You can’t perform that action at this time.
0 commit comments