问题
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