【发布时间】:2017-01-25 22:30:20
【问题描述】:
您好,我需要将两个按钮添加到单个列中。如何使用 UI-Grid (AngularJS) 来完成。
提前致谢:)
【问题讨论】:
您好,我需要将两个按钮添加到单个列中。如何使用 UI-Grid (AngularJS) 来完成。
提前致谢:)
【问题讨论】:
您可以使用cellTemplate 键入columnDefs
$scope.gridOptions = {
data: 'list',
multiSelect: false,
columnDefs: [{ field: 'name', displayName: 'Name'},
{ field: 'description', displayName: 'Description'},
{ displayName: 'Actions', cellTemplate:
'<div class="grid-action-cell">'+
'<a ng-click="$event.stopPropagation(); updateThisRow(row.entity);" href="#">Update</a>'+
'<a ng-click="$event.stopPropagation(); deleteThisRow(row.entity);" href="#">Delete</a></div>'}
]
};
【讨论】: