chandru
chandru

Reputation: 21

In UI Grid,How to add two buttons in a single cell

Hi i need to add two buttons into a single column..How to do it with UI-Grid (AngularJS).

Thanks in advance :)

Upvotes: 2

Views: 1769

Answers (1)

You can use cellTemplate key in 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>'}
            ]
    };

Upvotes: 2

Related Questions