Setting the rowTemplate on the ngGrid options causes all rows selection functions, like selectRow, to become undefined. This issue is quite perplexing.
For a demonstration, check out this link: http://plnkr.co/edit/m4GZftllwZzjYkEvXo3u?p=preview
// main.js
var app = angular.module('myApp', ['ngGrid']);
app.controller('MyCtrl', function($scope) {
$scope.myData = [{name: "Moroni", age: 50},
{name: "Tiancum", age: 43},
{name: "Jacob", age: 27},
{name: "Nephi", age: 29},
{name: "Enos", age: 34}];
$scope.gridOptions = { data: 'myData' };
$scope.gridOptions.rowTemplate = 'rowTemplate';
setTimeout(function(){
$scope.gridOptions.selectRow(3, true);
},0);
});
Attempting to select a row triggers an undefined exception. Simply removing the "rowTemplate" from the ngOptions resolves this issue!
Has anyone else experienced this problem?