PDA

View Full Version : how to set cell editable/noneditable in EditorTreeGrid



treblereel
18 Apr 2011, 6:15 AM
Hi all. How do i can set some (random ?) cells in EditorTreeGrid to be non-editable ?

micgala
18 Apr 2011, 6:47 AM
Hi.

Simply add a BeforeEdit event to the grid, and set the event cancelled to true if you want to make it non editable for the given cell.



editorGrid.addListener(Events.BeforeEdit, new Listener<GridEvent<BaseModel>>() {
public void handleEvent(GridEvent<BaseModel> be) {
if (not editable) {
be.setCancelled(true);
}
}
});


Regards,
Michel.

treblereel
18 Apr 2011, 7:31 AM
thanks, its works !