Angular UI-Grid: in cell template, how to access value from another field / cell

I am trying to use the Angular UI-Grid plugin to render data tables, and I have the following data examples:

var data = [
{"id" : 10, "name" : "Name 1", "city" : "San Francisco"},
{"id" : 12, "name" : "Name 2", "city" : "San Diego"},
{"id" : 20, "name" : "Name 3", "city" : "Santa Barbara"},
];

below is columnDefs for gridOptions, in the name field I need to create a hyperlink using ui-sref

$scope.gridOptions.columnDefs = [
{field: 'id', displayName: 'ID'},
{field: 'name',
cellTemplate: '<div class="ui-grid-cell-contents tooltip-uigrid" title="{{COL_FIELD}}">' +
                       '<a ui-sref="main.placeDetail{{placeId: \'{{row.entity.id}}\' }}">{{COL_FIELD CUSTOM_FILTERS}}</a></div>'
},
{field: 'city', enableSorting: true}
];

, row.entity.id. , ( name), : 1, 2 3 10, 12 20, , id, ID, - , : 10, 12 20. , id id ?

+4
1

ui-sref, JS. :

ui-sref="main.placeDetail({placeId: row.entity.id })"

+3

All Articles