2
我的表HTML如下:自定義單元格渲染器的行動不會觸發handsontable
<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
但我應該怎麼做?