只需修改网格中最后一列的headerCellTemplate(参见
https://github.com/angular-ui/ng-grid/wiki/Templating).
原文链接:https://www.f2er.com/angularjs/141346.html这是一个例子(注意< img src =“PLUS-ICON.png”/>在第二行):
var myHeaderCellTemplate = '<div class="ngHeaderSortColumn {{col.headerClass}}" ng-style="{\'cursor\': col.cursor}" ng-class="{ \'ngSorted\': !noSortVisible }">' + '<div ng-click="col.sort($event)" ng-class="\'colt\' + col.index" class="ngHeaderText">{{col.displayName}} <img src="PLUS-ICON.png" /></div>' + '<div class="ngSortButtonDown" ng-show="col.showSortButtonDown()"></div>' + '<div class="ngSortButtonUp" ng-show="col.showSortButtonUp()"></div>' + '<div class="ngSortPriority">{{col.sortPriority}}</div>' + '<div ng-class="{ ngPinnedIcon: col.pinned,ngUnPinnedIcon: !col.pinned }" ng-click="togglePin(col)" ng-show="col.pinnable"></div>' + '</div>' + '<div ng-show="col.resizable" class="ngHeaderGrip" ng-click="col.gripClick($event)" ng-mousedown="col.gripOnMouseDown($event)"></div>'; $scope.gridOptions = { data: self.myData,columnDefs: [ { field: 'firstField',displayName: 'First Column' },{ field: 'secondField',displayName: 'Second Column' },... { field: 'lastField',displayName: 'Last Column',headerCellTemplate: myHeaderCellTemplate } ] };