【发布时间】:2016-04-26 09:34:52
【问题描述】:
我的表格 html 看起来像:
<hot-table
settings="settings"
row-headers="rowHeaders"
min-spare-rows="minSpareRows"
datarows="myData"
columns="columns"
>
</hot-table>
我的选择:
$scope.columns = [
...
{
data:'name',
readOnly:true,
renderer:$scope.myRenderer
}
];
我的渲染器:
$scope.myRenderer = function(hotInstance, td, row, col, prop, value, cellProperties) {
var metaId = hotInstance.getDataAtRowProp(row, 'metaId');
var specificationCode = hotInstance.getDataAtRowProp(row, 'specificationCode');
if(value && specificationCode) {
td.innerHTML = '<a ng-click=\"openSpecification('+metaId+','+prop+','+specificationCode+')\">'+value+'</a>';
console.log(td.innerHTML);
}
};
单元格呈现正确,但ng-click 未触发。我什至只尝试了a href,但链接也不起作用。看起来我必须像 stopPropagation 或 preventDefault 那样做一些事情,但我应该在哪里以及如何做呢?
【问题讨论】: