I have a Angular ui-grid with the following grid options:
$scope.gridOptions = {
data: 'gridData',
enableColumnMenus: false,
enableRowSelection: false,
enableFullRowSelection: false,
enableSelectAll: false,
enableRowHeaderSelection: false,
multiSelect: false,
noUnselect: false,
columnDefs: [
{
field: 'FirstName',
name: 'First Name',
width: '*'
},
{
field: 'LastName',
name: 'Last Name',
width: '*'
},
{
field: 'RoleCode',
name: 'Role',
width: '*'
},
{
field: 'Notes',
name: 'Notes',
width: '*'
},
{
name:' ',
enableFiltering: false,
enableSorting: false,
enableColumnMenu: false,
width: '*',
cellTemplate:'<div>' +
'<a><button class="btn btn-primary btn-xs l-margin" ng-click="grid.appScope.onEditClick(row.entity)">Edit</button></a>' +
'<a><button class="btn btn-danger btn-xs l-margin" ng-click="grid.appScope.onDeleteClick(row.entity)">Delete</button></a>' +
'</div>'
}
],
onRegisterApi: function(gridApi){
$scope.$on('resize-grid',function() {
$timeout(function() {
gridApi.core.handleWindowResize();
});
});
}
};
One thing I'm noticing is that I'm getting a blank row at the top of the grid with the Edit and Delete buttons. I guess this is because they are in the cell template. Is there any way to not have the blank row on the top of the grid? Is there perhaps a property in grid options that I'm not aware of?
Thanks