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
}
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”的定制菜单。
检查这里的小提琴
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”的定制菜单。
检查这里的小提琴
Add menuItems function to $scope.gridOptions
menuItems:[{
title:'Grid Id',
action: function(){
//add your logic here
alert('Grid ID: ' + this.grid.id);
}
}],