在角ui网格中添加自定义菜单项到列菜单。

时间:2022-08-24 11:17:03

I want to add a custom menu item to column menu in ui-grid.

我想在ui-grid的列菜单中添加一个自定义菜单项。

$scope.gridOptions = {
                    paginationPageSizes: [25, 50, 75],
                    paginationPageSize: 25,
                    enablePaginationControls: true,
                    useExternalPagination: true,
                    useExternalSorting: true,
                    enableScrollbars: true,
                    enableColumnMenu: true,
                    enableRowSelection: true,
                    enableSelectAll: true
}

在角ui网格中添加自定义菜单项到列菜单。

Please help.

请帮助。

1 个解决方案

#1


2  

angular ui-grid provides functionality to customize the column menu - Customizing the Column menu

角ui网格提供了自定义列菜单的功能——自定义列菜单。

I've also created a fiddle which will add customized menu called "Grid Id" for Name column in the Column Menu .

我还创建了一个fiddle,它将为列菜单中的Name列添加名为“Grid Id”的定制菜单。

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

#1


2  

angular ui-grid provides functionality to customize the column menu - Customizing the Column menu

角ui网格提供了自定义列菜单的功能——自定义列菜单。

I've also created a fiddle which will add customized menu called "Grid Id" for Name column in the Column Menu .

我还创建了一个fiddle,它将为列菜单中的Name列添加名为“Grid Id”的定制菜单。

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