Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
knoobie opened this issue Feb 17, 2022 · 2 comments
Closed

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

knoobie opened this issue Feb 17, 2022 · 2 comments

Comments

@knoobie
Copy link
Contributor

knoobie commented Feb 17, 2022

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?

@OlliTietavainenVaadin
Copy link
Member

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

@sissbruecker
Copy link
Contributor

This should be resolved with vaadin/flow-components#6158

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants