I would like to create a custom column with a link and call $scope method on ng-click. There is very similar question for ngGrid (How to call a scope method from a button displayed in ngGrid -in Angular js) and that solution works. I'm using the ui-grid, which is supposed to be just a newer version of ngGrid, but it doesn't seem to work there.
Here is my code:
var app = angular.module('plunker', ['ui.grid']);
app.controller('MainCtrl', function($scope) {
$scope.gridOptions = {
data: [{name: 'test'}],
columnDefs: [{
field:'name',
displayName:'name',
cellTemplate: '<div ng-click="gridOptions.editUser()">Edit</div>'
}],
editUser: $scope.editUser
};
$scope.editUser = function() {
alert('It works!');
};
});
http://plnkr.co/edit/Q5SuIeAPFpZaUKbmIDCn
Here is the original solution for ngGrid that works: http://plnkr.co/edit/hgTQ1XdEVRyxscoNs76q