I want to call a javascript function from a UI-Grid cellTemplate, passing some of the row's entity values as parameters.
If I call the function directly from the href it gets the 'unsafe' prepended.
If I call it from the onclick attribute it does not bind properly (though does not get the unsafe prepended.)
How should I call it and have it bound properly?
href attempt:
columnDefs: [
{ name: "DocNumber", cellTemplate: '<a href=\'javascript:apci.LoadDoc("{{grid.appScope.selectedPayer.PayerRef}}")\'>{{row.entity.DocNumber}}</a>' },
]
onclick attempt:
columnDefs: [
{ name: "DocNumber", cellTemplate: '<a href="#" onclick=\'javascript:apci.LoadDoc("{{grid.appScope.selectedPayer.PayerRef}}")\'>{{row.entity.DocNumber}}</a>' },
]
Angular 1.5.0 UI-Grid 4.0.6