vaadin / web-components

A set of high-quality standards based web components for enterprise web applications. Part of Vaadin 20+
https://vaadin.com/docs/latest/components
429 stars 82 forks source link

[grid] Implement grid editor in the web component #1081

Open jcgueriaud1 opened 3 years ago

jcgueriaud1 commented 3 years ago

Hi,

In Java, there is an Grid Editor that helps the developer to create a inline row editor: https://vaadin.com/components/vaadin-grid/java-examples/grid-editor

In HTML/JS, we have a simple example, but no editor or helper for the developer: https://vaadin.com/components/vaadin-grid/html-examples/grid-crud-demos

The Grid pro component has a better example: https://vaadin.com/components/vaadin-grid-pro/html-examples

Is it planned to add a row editor in the grid component? Is there an example of an inline row editor with Fusion/Typescript? Or is it a missing feature?

web-padawan commented 3 years ago

The editing feature was implemented in the Flow counterpart for feature parity with the older Vaadin versions. We do not have this feature in the web component and AFAIK no plans to implement it.

Ideally, we would have equal set of features in vaadin-grid and GridFlow.

simasch commented 3 years ago

IMHO if you want to have the same success with Fusion that you have with Flow such features will be crucial.

rolfsmeds commented 2 years ago

No plans currently to port this functionality to the web component. As @web-padawan mentioned above, it was implemented in the Java component to aid migration from Vaadin 7 and 8. The recommendation is to use GridPro for inline editable datagrids.

simasch commented 2 years ago

@rolfsmeds GridPro does not provide everything you can do with the grid editor. We didn't use GridPro for that reason.

rolfsmeds commented 2 years ago

I can understand that @simasch, and I'm aware that the overall approach taken in GridPro is not a good fit for all use cases. You could make tickets about the missing features in GridPro, if there aren't ones yet.

simasch commented 2 years ago

@rolfsmeds I can't even fully remember what the issues were but I'll try to reproduce it and for sure will create tickets.

simasch commented 2 years ago

@rolfsmeds One issue was that there is no way to show validation messages with the component. And access to the Editor was very limited.

Another issue is this https://github.com/vaadin/flow-components/issues/1595

TatuLund commented 2 years ago

no way to show validation messages with the componen

This is somewhat handicapped even in Java version of the Grid Editor. One approach I have used is to use withValidationStatusHandler in Binder to toggle details row, where validation message is shown here: https://github.com/TatuLund/ProtoTools/blob/master/src/main/java/org/vaadin/addons/tatu/prototools/AutoGrid.java#L270

Other alternative is to use notification to show the validation message, which is used in this Grid Pro example https://cookbook.vaadin.com/grid-pro-binder

The both approaches could be used also with plain web component.

rolfsmeds commented 2 years ago

I created a ticket for the validation issue; feel free to add your ideas there: https://github.com/vaadin/web-components/issues/3162