如何在角度网格上自定义导出网格菜单? [英] How to customize the export grid menu on 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:
您可以使用
exporterMenuPdf隐藏用于导出的ui-grid菜单项:false,
exporterMenuCsv:false,
You can hide the ui-grid menu-entries for exporting by using exporterMenuPdf: false, exporterMenuCsv: false,
要添加一些自定义菜单项,可以使用
gridMenuCustomItems:[
{
icon:'fa fa-print',
title:'Text的菜单项',
action:function($ event){
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 } ],
希望它有帮助...
greets
Christian
Greets Christian
这篇关于如何在角度网格上自定义导出网格菜单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!