我想从 UI-Grid cellTemplate 调用一个 javascript 函数,将一些行的实体值作为参数传递。
如果我直接从 href 调用该函数,它会在前面加上“不安全”。
如果我从 onclick 属性调用它,它不会正确绑定(虽然没有得到 unsafe 前缀。)
我应该如何调用它并正确绑定它?
尝试:
columnDefs: [
{ name: "DocNumber", cellTemplate: '<a href=\'javascript:apci.LoadDoc("{{grid.appScope.selectedPayer.PayerRef}}")\'>{{row.entity.DocNumber}}</a>' },
]
点击尝试:
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