vaadin / platform

Vaadin platform 10+ is a Java web development platform based on Vaadin web components. If you don't know to which repository your bug report should be filed, use this and we'll move it to the right one.
https://vaadin.com
543 stars 78 forks source link

Grid Pro: Conditional cell editability #5177

Closed rolfsmeds closed 2 months ago

rolfsmeds commented 5 months ago

Description

An API in Grid for dynamically setting whether a cell is editable. (Similar e.g. to PartNameGenerator and TooltipGenerator)

Acceptance criteria

(precise naming of APIs is open for suggestions)

(* the latter would avoid possible confusion arising from being able to return true for cells in non-editable columns)

General criteria

Security

sissbruecker commented 5 months ago

Java API on the EditColumn class for setting an editability function setEditable(SerializableFunction<T,boolean> editabilityFunction)

The EditColumn type is currently not exposed to developers, as doing so would result in issues with method chaining. Calling a method from the Column superclass would return a Column instance, after which it is not possible anymore to chain methods from EditColumn. Instead, currently all EditColumn specific configuration is done with the EditColumnConfigurator. As such I suggested adding a withCellEditableProvider API to the configurator in https://github.com/vaadin/flow-components/pull/6158.