PDA

View Full Version : Toggling a cell's editability on/off on a per-row basis



ayqazi
10 May 2011, 6:23 AM
Hi,

So I have an EditableGridPanel, and I have a field (editableField) that may or may not be editable depending on the value of another field (anotherField). The user may not change 'anotherField', it is simply set to something when the grid is loaded.

For each row, if 'anotherField' is not null, 'editableField' may be edited by using a combo box. If 'anotherField' is null, 'editableField' should not be editable.

Is the above clear enough? Can anyone tell me how to accomplish this?

Thanks

fay
10 May 2011, 7:02 AM
Add a beforeedit (http://dev.sencha.com/deploy/ext-3.3.1/docs/?class=Ext.grid.EditorGridPanel&member=beforeedit) listener to the grid and set cancel true/false depending on your need.