0
rated 0 times
[
1]
[
1]
/ answers: 1 / hits: 20017
/ 11 Years ago, wed, november 6, 2013, 12:00:00
How does one pass {{row.getProperty(col.field)}}
into ng-click
? What happens is the id does not get propagated back, but the grid render correctly with the id.
code:
var app = angular.module('testing',['ngGrid']);
app.config(['$locationProvider', function($locationProvider)
{
$locationProvider.html5Mode(true);
}]);
app.controller('TestCtrl',function($scope)
{
$scope.details = []; //whatever dummy data
$scope.loadById = function(id)
{
$window.location.href= 'newPage/?id='+id;
};
$scope.gridOptions =
{
data: 'details',
columnDefs:[{field:'id',DisplayName:'id',
cellTemplate:'<div class=ngCellText ng-class=col.colIndex()><a ng-click=loadById({{row.getProperty(col.field)}})>{{row.getProperty(col.field)}}</a></div>'
}]
};
});
More From » angularjs