我已经为handsontable中的复选框应用了自定义呈现器。我的handsontable在其所有行和列中只有复选框。只读属性将应用于在handsontable的设置中指定的行,但是当我在任何复选框上第一次点击时,它会让我取消选中它。一旦完成一次单击,它就会使它只读复选框自定义呈现为handsontable不起作用
function readonly(instance, td, row, col, prop, value, cellProperties) {
Handsontable.CheckboxCell.renderer.apply(this, arguments);
cellProperties.readOnly = true;
td.style.background = '#ECECF2';
var settings1 = {
data:$scope.secondGridData,
stretchH: 'false',
fillHandle: false,
colWidths: [85,120, 63, 63, 63,63, 63,63, 63,63, 63, 63, 63,63],
comments: true,
contextMenu: false,
className: "htCenter",
cells: function (row, col, prop) {
var cellProperties = {};
if((row>=1())){
cellProperties.renderer = readonly;
}
return cellProperties;
}
小提琴请好吗? –