mvysny / vaadin-on-kotlin

Writing full-stack statically-typed web apps on JVM at its simplest
https://www.vaadinonkotlin.eu/
MIT License
186 stars 17 forks source link

Vaadin Grid and Grid editor #20

Closed akatecker closed 6 years ago

akatecker commented 6 years ago

This is more like a feature request, in order to make your awseome project even easier to use. The one feature that brought me into the Vaadin world was Grids and specially the inline editing provided by Grids. Unfortunately documentation on this aspect is not very extensive, this beeing true for original Vaadin as well as for VoK. Key things I had to learn so far where:

Things that I still struggle with but could be interesting for others too:

I understand that making such samples that are easy enough to be understood yet show all the complex features is very time consuming, but I think that adding such into the grid (or even a new grid editor) section of karibudsl would greatly help future newbie VoK users.

All the best

mvysny commented 6 years ago

Thanks! You're right: the Grid editing capabilities are somewhat underdocumented. There is some documentation at https://vaadin.com/docs/v8/framework/components/components-grid.html but it is far from complete. Let me check what can be done in this regard.

At least I can give you a hint on programmatic filtering of DataSources in the Grid. When you use EntityDataProvider (or Person.dataProvider), that data provider is already configurable, in a way that you can call setFilter() on it and it will automatically refresh the Grid. I believe that having all DataProviders always configurable is a good practice. SqlDataProvider is not by default configurable, but you can very easy convert it to configurable, simply by calling .withConfigurableFilter2() on it.

mvysny commented 6 years ago

Yet you're right about the missing documentation. I've started by creating the Guides section here: http://www.vaadinonkotlin.eu/vok-guides.html

So far it only contains the database guide, but that should hopefully give enough information to get you started with fetching data, forms and Grids. Of course please feel free to provide more documentation, basically anything info you're missing right now; the documentation sources are here: https://github.com/mvysny/vaadin-on-kotlin/tree/master/docs

mvysny commented 6 years ago

Regarding the Editor documentation - I believe it's primary the Vaadin guys's responsibility to add documentation for this. Could you please open a bug report at https://github.com/vaadin/framework/issues regarding this?

mvysny commented 6 years ago

I have created the Grid VoK Guide here: http://www.vaadinonkotlin.eu/grids.html - please feel free to provide documentation on the Grid Editors - your experience is most welcomed.

NiranjanShah commented 6 years ago

Will the same be applicable for Vaadin 10 ? Regards Niranjan G Shah

On 03-Apr-2018, at 12:28 PM, Martin Vysny notifications@github.com wrote:

I have created the Grid VoK Guide here: http://www.vaadinonkotlin.eu/grids.html http://www.vaadinonkotlin.eu/grids.html - please feel free to provide documentation on the Grid Editors - your experience is most welcomed.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mvysny/vaadin-on-kotlin/issues/20#issuecomment-378148038, or mute the thread https://github.com/notifications/unsubscribe-auth/AI4lwtVA6MYtvC4pZNGCH-uRVclkSJd5ks5tkx2FgaJpZM4S3F0J.

mvysny commented 6 years ago

That's a good question. There are areas which V8 and V10 Grids have in common: the data provider for example. However, in some areas the APIs are way different: the renderers, the lack of adding additional headers with V10 Grid... I need time to think about this. It may be possible that I will have to introduce a separate set of Guides for Vaadin10 VoK and for Vaadin8 VoK.

akatecker commented 6 years ago

Good afternoon!

Thank you for adding this documentation. Although you are right, it is basically the task of Vaadin to do this, a shortcut through their documentation with samples based on VoK can greatly improve the use case for your project.

I tried add some more content to your guide concerning grid editing, but beware that I have'nt got it 100% right myself:

Best regards, Alexander Grid.md.txt

mvysny commented 6 years ago

Hi, thanks for the contribution! I'll take a look and merge the guide into the current one.

mvysny commented 6 years ago

Awesome work @hromatka - well investigated and well written. I took the liberty to rewrite the tutorial a bit so that uses the addColumnFor API. The tutorial is present at http://www.vaadinonkotlin.eu/grids.html , please review. Also I believe this work deserves a copyright, so please let me know what kind of copyright statement should I added to the appropriate section of the guide.

mvysny commented 6 years ago

Marking as closed, please feel free to reopen if there is additional feedback.