How to customize the export grid menu on angular-ui-grid?

五迷三道 提交于 2019-12-14 03:54:40

问题


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?

Please help! Thank you.

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


回答1:


Good morning

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

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

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 } ],

Hope it helps...

Greets Christian



来源:https://stackoverflow.com/questions/34314536/how-to-customize-the-export-grid-menu-on-angular-ui-grid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!