radiobutton or checkbox in my grid in mode Read Only

I wanted to know how can I do in order to have radiobutton or checkbow in my grid in mode “Read Only”.

I don’t want the customer could modify the value (true or false).

Thanks

You can disable checkboxes/radiobuttons using setDisabled(true) method:
mygrid.cellById(rowId,cellIndex).setDisabled(true)
dhtmlx.com/docs/products/dht … excellsapi


Hi,



I have similar question to the one posted here. I set my checkboxes to readonly by:



function disableCheckBoxes(grid) {
  var colNum = grid.getColumnsNum();
  for (var i = 0; i < colNum; i++) {
    if (grid.getColType(i) == ‘ch’) {
      disableCol(grid, i);
    }
  }
}




Later on, I update the values of particular cells by using an API call:



mygrid.cells(id, i).setValue(xxx);



The cells remain read-only (non-clickable), but they are no longer drawn as disabled! In fact, they look much better now! (see the attached snapshot, rows #3 and 5)



How to achieve this effect from the very beginning?



Regards,



Plamen




Hello,


in this case instead of disabling checkboxes you can use onEditCell to block editing for “ch” column:


grid.attachEvent(“onEditCell”,function(stage,id,index){



if(index == ch_index) return false
return true


})


Here ch_index is index of ch column.