Make sure you set enableGridMenu to false.
and inside the GridOptions do something like this:
'exporterCsvFilename' : 'clarification-status.csv',
exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")),
onRegisterApi: function(gridApi){
vm.gridApi = gridApi;
},
and then you need to use the export csv or exportpdf functions like this.
vm.exportCsv = function() {
var grid = vm.gridApi.grid;
var rowTypes = uiGridExporterConstants.ALL;
var colTypes = uiGridExporterConstants.ALL;
uiGridExporterService.csvExport(grid, rowTypes, colTypes);
};
and inside your html view, you need to call this exportcsv() function as shown below.
<img ng-src="public/images/excel-icon.png" ng-click="vm.exportCsv()" />