Skip to content

Commit 04c8f7f

Browse files
committed
Merge pull request #3027 from AlphaHinex/feat-exporter-menu-all
Feat(exporter): add exporterMenuAllData property
2 parents eb8b972 + 5fb48f4 commit 04c8f7f

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/features/exporter/js/exporter.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,14 @@
350350
* <br/>Defaults to null, which means no layout
351351
*/
352352

353+
/**
354+
* @ngdoc object
355+
* @name exporterMenuAllData
356+
* @porpertyOf ui.grid.exporter.api:GridOptions
357+
* @description Add export all data as cvs/pdf menu items to the ui-grid grid menu, if it's present. Defaults to true.
358+
*/
359+
gridOptions.exporterMenuAllData = gridOptions.exporterMenuAllData !== undefined ? gridOptions.exporterMenuAllData : true;
360+
353361
/**
354362
* @ngdoc object
355363
* @name exporterMenuCsv
@@ -470,7 +478,7 @@
470478
this.grid.api.exporter.csvExport( uiGridExporterConstants.ALL, uiGridExporterConstants.ALL );
471479
},
472480
shown: function() {
473-
return this.grid.options.exporterMenuCsv;
481+
return this.grid.options.exporterMenuCsv && this.grid.options.exporterMenuAllData;
474482
}
475483
},
476484
{
@@ -498,7 +506,7 @@
498506
this.grid.api.exporter.pdfExport( uiGridExporterConstants.ALL, uiGridExporterConstants.ALL );
499507
},
500508
shown: function() {
501-
return this.grid.options.exporterMenuPdf;
509+
return this.grid.options.exporterMenuPdf && this.grid.options.exporterMenuAllData;
502510
}
503511
},
504512
{

src/features/exporter/test/exporter.spec.js

+3
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ describe('ui.grid.exporter uiGridExporterService', function () {
8080
exporterPdfMaxGridWidth : 720,
8181
exporterPdfCustomFormatter: jasmine.any(Function),
8282
exporterHeaderFilterUseName: false,
83+
exporterMenuAllData: true,
8384
exporterMenuCsv: true,
8485
exporterMenuPdf: true,
8586
exporterFieldCallback: jasmine.any(Function),
@@ -105,6 +106,7 @@ describe('ui.grid.exporter uiGridExporterService', function () {
105106
exporterPdfMaxGridWidth : 670,
106107
exporterPdfCustomFormatter: callback,
107108
exporterHeaderFilterUseName: true,
109+
exporterMenuAllData: false,
108110
exporterMenuCsv: false,
109111
exporterMenuPdf: false,
110112
exporterFieldCallback: callback,
@@ -127,6 +129,7 @@ describe('ui.grid.exporter uiGridExporterService', function () {
127129
exporterPdfMaxGridWidth : 670,
128130
exporterPdfCustomFormatter: callback,
129131
exporterHeaderFilterUseName: true,
132+
exporterMenuAllData: false,
130133
exporterMenuCsv: false,
131134
exporterMenuPdf: false,
132135
exporterFieldCallback: callback,

0 commit comments

Comments
 (0)