有没有办法从ui-grid下拉菜单中删除导出到pdf的选项?我想保留导出到csv的能力,但不知道如何在不删除所有导出功能的情况下删除pdf功能。
我从文档中编辑了this plunker,删除了与pdf exporter相关的所有脚本和JavaScript。这将有效地禁用该功能,但菜单中仍可使用导出为pdf的选项。
app.controller('MainCtrl', ['$scope', '$http', function ($scope, $http) {
$scope.gridOptions = {
columnDefs: [
{ field: 'name' },
{ field: 'gender', visible: false},
{ field: 'company' }
],
enableGridMenu: true,
enableSelectAll: true,
exporterCsvFilename: 'myFile.csv',
exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")),
onRegisterApi: function(gridApi){
$scope.gridApi = gridApi;
}
};
发布于 2015-07-21 13:47:00
在柱塞中的第12行添加以下栅格选项(默认值为true
):
exporterMenuPdf: false,
结果如下所示:
app.controller('MainCtrl', ['$scope', '$http', function ($scope, $http) {
$scope.gridOptions = {
columnDefs: [
{ field: 'name' },
{ field: 'gender', visible: false},
{ field: 'company' }
],
enableGridMenu: true,
enableSelectAll: true,
exporterMenuPdf: false, // ADD THIS
exporterCsvFilename: 'myFile.csv',
exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")),
onRegisterApi: function(gridApi){
$scope.gridApi = gridApi;
}
};
有关所有可能的选项,请参阅http://ui-grid.info/docs/#/api/ui.grid.exporter.api:GridOptions。
https://stackoverflow.com/questions/31531155
复制相似问题