Read-only checkbox

Dear Sir,

I wish have a read-only checkbox.

In xml, if I set:

type=‘ro’

then it shows 0 or 1 on UI i.e. the index and it is not showing the checkbox.

Please tell me the correct way to send the status of checkbox in xml and keep it read-only.



Thanks in advance.

You cans use setDisabled(true) method for the  “co” column.

mygrid.loadXML(“grid.xml”, function(){
   for (var i=0; i<mygrid.getRowsNum(); i++){
      mygrid.cellByIndex(i,columnIndex).setDisabled(true);
   }
});

Dear Sir,
By this way, we will disable all the check boxes in that column. But, I want only selected rows to have disabled/read-only check boxes.

While generating the xml, I have the information regarding which all rows will be having a read-only check-box. But, I dont have this info. on the UI.

So, I there any way to set some flag or something in the xml itself?

Starting from dhtmlxgrid 1.6 you can use any custom attributes in XML, so when generating XML you can have



and later in js code

mygrid.loadXML(“grid.xml”, function(){
mygrid.forEachRow(function(id){
if (mygrid.getRowAttribute(id,“disabled_checkbox”)
mygrid.cellById(id,columnIndex).setDisabled(true);
});
});