Modifiez l'icône MenuItem dans ui.gird angulaire

Comment basculer les icônes customizing_column_menu dans ui.grid angulaire comme indiqué ci-dessous

Entrez la description de l'image ici

Entrez la description de l'image ici

Je n'ai pas trouvé la meilleure solution pour changer les éléments de menu dynamiquement, voici ce que j'ai fait pour la solution de contournement

Code

$scope.gridOptions = { rowHeight: 75, columnDefs: [{ field: 'name', enableColumnMenu: false }, { field: 'gender', enableHiding: false, suppressRemoveSort: true, sort: { direction: uiGridConstants.ASC } }, { field: 'All Details', cellTemplate: '<p ng-show="grid.appScope.company"><label><b>Company:</b></label><span>{{row.entity.company}}</span></p><p ng-show="grid.appScope.email"><label><b>email:</b></label><span>{{row.entity.email}}</span></p>', menuItems: [{ title: 'Company', icon: 'ui-grid-icon-ok', action: function() { $scope.company = $scope.company ? false : true; }, context: $scope, shown: function() { return this.context.company; } },{ title: 'Company', icon: 'ui-grid-icon-cancel', action: function() { $scope.company = $scope.company ? false : true; }, context: $scope, shown: function() { return !this.context.company; } }, { title: 'Email', icon: 'ui-grid-icon-ok', action: function() { $scope.email = $scope.email ? false : true; }, context: $scope, shown: function() { return this.context.email; } }, { title: 'Email', icon: 'ui-grid-icon-cancel', action: function() { $scope.email = $scope.email ? false : true; }, context: $scope, shown: function() { return !this.context.email; } }] }] }; 

Travailler Plunkr