如何在 angular-ui-grid 上自定义导出网格菜单? [英] How to customize the export grid menu on angular-ui-grid?

查看:34
本文介绍了如何在 angular-ui-grid 上自定义导出网格菜单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网格,它有一个外部显示详细信息"选项,可以向网格添加更多列.

I have a grid that has an external "Show Details" option which would add more columns to the grid.

问题是导出所有数据"与导出可见数据"在这一点上变得具有欺骗性.

The issue is the "Export all data" vs "Export visible data" which becomes deceiving at this point.

我知道可见数据就是加载的数据,但在这种情况下,所有数据都会一次性加载.因此,用户会认为可见数据"就是他们所看到的,而所有数据"也包括点击显示详细信息"时添加的列,但不幸的是,事实并非如此.

I understand that visible data is what data gets loaded, but in this case, all the data gets loaded at once. Therefore, users would think that "visible data" would be what they are seeing and "all data" would also include the columns that gets added when "show details" is clicked which unfortunately is not the case.

是否可以自定义网格菜单?或者至少隐藏导出可见数据"选项?

Is it possible to customize the grid menu? Or at least hide the "Export visible data" options?

请帮忙!谢谢.

参考:http://ui-grid.info/docs/#/api/ui.grid.exporter.api:GridOptions

推荐答案

早上好

我在我的项目中遇到了同样的问题,我在选项中使用了以下配置:

I had the same problem in my project and i used following configuration in the options:

您可以使用以下命令隐藏用于导出的 ui-grid 菜单项出口商MenuPdf:假,exporterMenuCsv: false,

You can hide the ui-grid menu-entries for exporting by using exporterMenuPdf: false, exporterMenuCsv: false,

要添加一些自定义菜单项,您可以使用gridMenuCustomItems: [{图标:'fa fa-print',title: '菜单项的文本',动作:函数($事件){self.someFunction();},订单:100}],

To add some custom menu-entries, you can use gridMenuCustomItems: [ { icon: 'fa fa-print', title: 'Text of the menu-item', action: function ($event) { self.someFunction(); }, order: 100 } ],

希望能帮到你...

问候克里斯蒂安

这篇关于如何在 angular-ui-grid 上自定义导出网格菜单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆