I'm using UI-Grid framework to show tabular data with server side pagination and the grid menu turned on. On my "exportAllDataFn" I'm making an Ajax call to the server to pull that data, but I'm limiting the number of rows exported to a few thousand since the data set large enough to crash the browser if "all" data is exported. I want to change the default text of the menu option from "Export all data as CSV" to semething more indicative of what's happening, maybe "Export all data (max 2500 rows)". There does not seem to be a "gridOption" to set this. And after googling the question, didn't find too many good options. I'm using a bit of a hack to accomplish this now, but I feel like there should be a simeple solution. How do I change the title of the dafault menu options?
Asked
Active
Viewed 1,176 times
1 Answers
3
After digging through UI-Grid code, I found a solution that works for me. I'm adding the i18nService to my controller and then changing the "i18nService.get('en').gridMenu.exporterAllAsCsv" property.
app.controller('myCtrl', ['i18nService', function(i18nService){
// . . .
// 'en' for English
i18nService.get('en').gridMenu.exporterAllAsCsv = 'Export all data as CSV (max 2500 rows)';

Sanjeev
- 1,517
- 1
- 18
- 30
-
Sanjeev, do you know if there is an option to suppress "export visible data as csv" option somehow? – kiev Jan 31 '18 at 22:14
-
1@kiev, Sorry this is late. I actually did reply earlier but forgot to reference your name in the reply. Here is post that might help you https://stackoverflow.com/questions/31531155/remove-export-to-pdf-option-in-angular-ui-grid – Sanjeev Sep 27 '20 at 15:42