-1

I have applied a custom renderer for check boxes in the handsontable.My handsontable has only checkboxes in all of its row and column. The read only property will be applied for the rows specified in the settings of the handsontable, but when I click for the first time on any of the checkbox,it willa loow me to uncheck it.Once one click is done,it is making it readonly

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;
}
Nikhil Bharadwaj
  • 867
  • 4
  • 24
  • 42

1 Answers1

0

Well for one thing, your settings seem to be defined inside your renderer so probably don't do that. And you're supposed to return the td which is why your renderer isn't working. Fix those two things and it should work.

ZekeDroid
  • 7,089
  • 5
  • 33
  • 59
  • ,Settings is outside the rendering function.My bad,forgot to include the braces. But what do you mean return the td? I did not get it – Nikhil Bharadwaj Nov 04 '15 at 05:20
  • you see how your function `readonly` takes `td` as an argument? That's the actual HTML node. You have to return this object otherwise your render changes don't get applied. – ZekeDroid Nov 04 '15 at 15:45