Reputation: 257
I want to add a custom menu item to column menu in ui-grid.
$scope.gridOptions = {
paginationPageSizes: [25, 50, 75],
paginationPageSize: 25,
enablePaginationControls: true,
useExternalPagination: true,
useExternalSorting: true,
enableScrollbars: true,
enableColumnMenu: true,
enableRowSelection: true,
enableSelectAll: true
}
Please help.
Upvotes: 2
Views: 3624
Reputation: 125
angular ui-grid provides functionality to customize the column menu - Customizing the Column menu
I've also created a fiddle which will add customized menu called "Grid Id" for Name column in the Column Menu .
Add menuItems function to $scope.gridOptions
menuItems:[{
title:'Grid Id',
action: function(){
//add your logic here
alert('Grid ID: ' + this.grid.id);
}
}],
Upvotes: 2