disabling a column in dhtmlxgrid


Is there any way to disable a column in dhtmlxgrid based on conditions of another column?

We have this requirement where we have to give either/or entry capability in between two columns. So, when the user starts entering data in one column, the other column should get disabled. I tried using returning false during “onEditCell” but it didn’t work as my condition is dependent on some other column.

Any help will be highly appreciated.

Monica Patra

The common way in this situation is to use the onEditCell event.
It should work well in this scenario.
Something like this:

grid.attachEvent("onEditCell", function(stage,rId,cInd,nValue,oValue){ if(stage==0){ //stage before actual editor opening if (cInd==n) // required disabling column{ if (mygrid.cellById(rId,m).getValue()==some) // checking the value of a cell in "some other column" return false // block the edit operation } } return true // allow the edit operation });
If the issue still occurs for you please, provide with a snippet of your using code.