Wanted to access a function from my custom cellTemplate. For that, i am using grid.appScope. Following is the code :
$scope.test = function(){
alert('a');
};
columnDefs: [
{ field: 'name', displayName: 'Name', cellTemplate: '<div ng-click="grid.appScope.test()">ABCDEFGH</div>' },
{ field: 'id', displayName: 'ID' }
]
Can anyone tell me what is the issue with the above code ?
I have face the same problem and able to resolve it in my case we have made the grid as directive in that it is not able to recognize the test function. In order to do that just use $parent scope
like this
grid.appScope.$parent.test();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With