2016-03-08 110 views
2

我想将自定义菜单项添加到ui网格中的列菜单。将自定义菜单项添加到角度ui网格中的列菜单

$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

请帮助。

回答

2

角度UI电网提供的功能,自定义列菜单 - Customizing the Column menu

我还创建了一个小提琴将在列菜单添加一个名为“网格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); 
       } 
      }], 
+0

完美。非常感谢。 – user3816152

+2

你知道是否有办法全局配置菜单项?你的答案似乎暗示着这一点,但你的小提琴在列级配置这些。谢谢 – ryanp102694

相关问题