如何更改 UI-Grid 菜单选项的默认文本

How to change the default text of UI-Grid menu option

我正在使用 UI-Grid 框架来显示带有服务器端分页和网格菜单的表格数据。在我的 "exportAllDataFn" 上,我正在向服务器发出 Ajax 调用以提取该数据,但我将导出的行数限制为几千,因为数据集大到足以使浏览器崩溃如果 "all" 数据被导出。我想将菜单选项的默认文本从 "Export all data as CSV" 更改为更能说明正在发生的事情的内容,也许是 "Export all data (max 2500 rows)"。似乎没有 "gridOption" 来设置它。在谷歌搜索这个问题后,没有找到太多好的选择。我现在正在使用一些 hack 来完成此操作,但我觉得应该有一个简单的解决方案。如何更改默认菜单选项的标题?

在深入研究 UI-Grid 代码后,我找到了适合我的解决方案。我将 i18nService 添加到我的控制器,然后更改 "i18nService.get('en').gridMenu.exporterAllAsCsv" 属性。

app.controller('myCtrl', ['i18nService', function(i18nService){

// . . . 

// 'en' for English
i18nService.get('en').gridMenu.exporterAllAsCsv = 'Export all data as CSV (max 2500 rows)';