我已經爲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;
}
小提琴請好嗎? –