web-components icon indicating copy to clipboard operation
web-components copied to clipboard

[grid-pro] Provide a configuration which row is editable

Open knoobie opened this issue 2 years ago • 1 comments

Describe your motivation

In some applications not all rows should be editable. Some could be summaries or the user is not allowed to edit them (readonly / un-editable).

Describe the solution you'd like

grid.addEditColumn(GridRow::getValue)
      .text((item, newValue) -> {
        item.setValue(newValue);
      })
     .setEditAllowed(e -> e.isLocked() ? false : true);

Alternative

Use a custom field as editor and add addCellEditStartedListener to disable the fields if the user is not allowed to edit it.. not really good UX tho.. Why should somebody TAB inside a field that isn't allowed to be edited?

knoobie avatar Feb 17 '22 14:02 knoobie

Just adding a comment to use the words "uneditable", "gridpro" and "readonly" so this issue might show up in more searches 😃

OlliTietavainenVaadin avatar Sep 16 '22 09:09 OlliTietavainenVaadin

This should be resolved with https://github.com/vaadin/flow-components/pull/6158

sissbruecker avatar Jul 09 '24 19:07 sissbruecker