user3816152
user3816152

Reputation: 257

Add custom menu item to column menu in angular ui grid

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
}

enter image description here

Please help.

Upvotes: 2

Views: 3624

Answers (1)

Vigneshwarr
Vigneshwarr

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 .

Check the Fiddle here

Add menuItems function to $scope.gridOptions
 menuItems:[{
                title:'Grid Id',
                action: function(){
                         //add your logic here
                    alert('Grid ID: ' + this.grid.id);
                }
            }], 

Upvotes: 2

Related Questions