Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Ranjith on Jul 17, 2008 00:15
open dhtmlx forum
Is it possible to set the cells of particular rows to read-only ?

Hi,

I am having an issue, with setting the cells of various rows which are selected by the user by checking the checkboxes. I tried using setColType(ro,ro,ro.....), but this sets the complete columns in the grid to read only, and is not catering to my requirement. Is there any way by which i could point out a particular row and then set the column within that row to read-only ?

Thanks,
Ranjith
Answer posted by Support on Jul 17, 2008 02:33
You can
a) lock row ( prevent any operations against it )
    grid.lockRow(id);

or

b) change types of cells to ro, for selected row only
    grid.setRowExcellType(id,"ro");
Answer posted by Ranjith on Jul 17, 2008 03:55
Hi,

Thanks for the snippet. But, im still having a problem with the same. In my grid there are checkboxes and an image in the row. When i set a particular row to "ro", the checkboxes and the image disappears. But apart from that all the other text boxes and combos are set to readonly. Please let me know if there is a way i can set each cell of the particular row to the desired status.

Thanks,
Ranjith
Answer posted by Support on Jul 17, 2008 06:17
When you are using
    setRowExcellType
all cells in column switched to required type - read-only text field, which cause conversion of checkboxes and images

You still can use
    grid.lockRow(id);

Or disable cell edit on lower level by
    grid.forEachCell(id,function(c){
       c.setDisabled(true);
    });