Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Gird - Prevent editing of certain Items
Hello,
is it possible to prevent the editing for certain item ids?
Something like
grid.setItemEditable(itemId, false);
Thank you already!
Hi,
Never tried but implementing your own DefaultEditorEventHandler should do the job :
https://vaadin.com/api/7.6.4/com/vaadin/client/widget/grid/DefaultEditorEventHandler.html#handleOpenEvent%28com.vaadin.client.widgets.Grid.EditorDomEvent%29
Regards
Yeah, I usually use this:
Grid grid = new Grid(beanItemContainer);
grid.getColumn("beanFieldName").setEditable(false)
Sebastien Libert: Hi,
Never tried but implementing your own DefaultEditorEventHandler should do the job :
https://vaadin.com/api/7.6.4/com/vaadin/client/widget/grid/DefaultEditorEventHandler.html#handleOpenEvent%28com.vaadin.client.widgets.Grid.EditorDomEvent%29
Regards
Thank you for your suggestion. So as far as I can see I have to replace this handler on the client side, extend the grid and create a custom grid for it, correct?
I think I will create an enhancement request for this, as I think this is a common use case that one wants to prevent editing of certain items.
@Alisa Lee:
This only prevents the editing of a certain column (property) not row (item).
Hello,
You do not need to extend Grid nor create a custom grid. you need to extend DefaultEditorEventHnadler and make a grid.setEditorEventHandler() with your own class
Regards