Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using row values in ng-grid column cellTemplate

I'm trying to add a column that have a link to another page (is an ng-grid table). That link contains one of the values of the row

I tried something like this:

$scope.columns = [
  {field:'id', displayName:'#'},
  {field:'name', displayName:'Name'},
  {field:'view', displayName:'Action', cellTemplate: '<a href="http://foo.com/person/' +  {row.getProperty(col.id)} + '">[View Details]</a>'}
];

But is not working, any ideas?

like image 639
agusluc Avatar asked Feb 08 '14 15:02

agusluc


1 Answers

The expression should be

{{row.getProperty(col.id)}}

or

{{row.getProperty(\'id\')}}

like image 118
Chandermani Avatar answered Sep 17 '22 20:09

Chandermani