Disable or hide 'Delete' button when using Crud

In my entity model I never want to delete entities and thus want to disable deletion when using Vaadin CRUD. Can I hide the default ‘Delete…’ button via CSS?

There is currently no way to get the Button instance via API. There is an [open github ticket]
(https://github.com/vaadin/vaadin-crud-flow/issues/201) for this, please go and give it a thumbs up. Once it is implemented, you’ll be able to remove the delete button from the layout.

Styling anything within the Crud Editor [is also quite a pain]
(https://github.com/vaadin/vaadin-crud-flow/issues/187) I believe, although I haven’t tried it yet myself. But when inspecting the html of the editor overlay, I wouldn’t be able to differentiate between any of the footer buttons using CSS selectors - they don’t have a delete-button class or similar.

Thanks for the quick response and I agree with your analysis. At the moment the CRUD component isn’t in s state that allows me to use it in a production system so I’ll have to handcraft a solution. Once a fix is in place for the ‘delete’ issue, I may revisit.

I’ve found that it is possible to effectively hide the delete button by setting CrudI18n on the Crud instance with crudI18n.setDeleteItem(“”) i.e. setting the caption on the delete button to an empty string. This is most certainly an ugly hack, but is fine for the time being. I do think that the ability to turn off crud actions should be available programmatically.

We have made also fork of CRUD under our Component Factory program called Enhanced CRUD which has some improvements, e.g. giving better access to buttons.