Skip to content

Commit

Permalink
Merge pull request #3027 from AlphaHinex/feat-exporter-menu-all
Browse files Browse the repository at this point in the history
Feat(exporter): add exporterMenuAllData property
  • Loading branch information
PaulL1 committed Mar 18, 2015
2 parents eb8b972 + 5fb48f4 commit 04c8f7f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/features/exporter/js/exporter.js
Expand Up @@ -350,6 +350,14 @@
* <br/>Defaults to null, which means no layout
*/

/**
* @ngdoc object
* @name exporterMenuAllData
* @porpertyOf ui.grid.exporter.api:GridOptions
* @description Add export all data as cvs/pdf menu items to the ui-grid grid menu, if it's present. Defaults to true.
*/
gridOptions.exporterMenuAllData = gridOptions.exporterMenuAllData !== undefined ? gridOptions.exporterMenuAllData : true;

/**
* @ngdoc object
* @name exporterMenuCsv
Expand Down Expand Up @@ -470,7 +478,7 @@
this.grid.api.exporter.csvExport( uiGridExporterConstants.ALL, uiGridExporterConstants.ALL );
},
shown: function() {
return this.grid.options.exporterMenuCsv;
return this.grid.options.exporterMenuCsv && this.grid.options.exporterMenuAllData;
}
},
{
Expand Down Expand Up @@ -498,7 +506,7 @@
this.grid.api.exporter.pdfExport( uiGridExporterConstants.ALL, uiGridExporterConstants.ALL );
},
shown: function() {
return this.grid.options.exporterMenuPdf;
return this.grid.options.exporterMenuPdf && this.grid.options.exporterMenuAllData;
}
},
{
Expand Down
3 changes: 3 additions & 0 deletions src/features/exporter/test/exporter.spec.js
Expand Up @@ -80,6 +80,7 @@ describe('ui.grid.exporter uiGridExporterService', function () {
exporterPdfMaxGridWidth : 720,
exporterPdfCustomFormatter: jasmine.any(Function),
exporterHeaderFilterUseName: false,
exporterMenuAllData: true,
exporterMenuCsv: true,
exporterMenuPdf: true,
exporterFieldCallback: jasmine.any(Function),
Expand All @@ -105,6 +106,7 @@ describe('ui.grid.exporter uiGridExporterService', function () {
exporterPdfMaxGridWidth : 670,
exporterPdfCustomFormatter: callback,
exporterHeaderFilterUseName: true,
exporterMenuAllData: false,
exporterMenuCsv: false,
exporterMenuPdf: false,
exporterFieldCallback: callback,
Expand All @@ -127,6 +129,7 @@ describe('ui.grid.exporter uiGridExporterService', function () {
exporterPdfMaxGridWidth : 670,
exporterPdfCustomFormatter: callback,
exporterHeaderFilterUseName: true,
exporterMenuAllData: false,
exporterMenuCsv: false,
exporterMenuPdf: false,
exporterFieldCallback: callback,
Expand Down

0 comments on commit 04c8f7f

Please sign in to comment.