Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Satheesh Kumar K on Jul 25, 2008 08:40
open dhtmlx forum
Disable Cell

I have a requirement to disable the cell edit if the value of the cell is 0.This i have to do on the following scenarios

a) Load of the grid
b) Adding a new row
c) Edit a row.
Answer posted by Support on Jul 25, 2008 09:47
you can add next code to grid's init

    grid.attachEvent("onEditCell",function(stage,id,ind){
          if ( stage == 0 && this.cells(id,ind).getValue()==="0" ) return false;
          return true;
    });
Answer posted on Jul 25, 2008 09:58
I mean that cell should be disabled.but this code stilll makes users to edit the cell.So please help me on this
Answer posted on Jul 28, 2008 01:48
The code above disable edit for cells, their value are equal to 0.
Please check attached sample.
Attachments (1)