Using the inline java editing example for a Vaadin 14 / Flow Grid at: https://vaadin.com/docs/latest/ds/components/grid/#inline-editing-java-only (ignoring the save and cancel portion) how can I add an edit button for a compact grid. All other cells seem to be of height 30px but the addComponentColumn() seems to be of height 46px. There's a setWidth()
method but no setHeight()
. My code is:
Column<T> editColumn = addComponentColumn(t -> {
Button editButton = new Button("Edit");
editButton.addThemeVariants(ButtonVariant.LUMO_SMALL);
editButton.addClickListener(click -> {
if(getEditor().isOpen())
getEditor().cancel();
getEditor().editItem(t);
});
return editButton;
})
And to change the width I can do editColumn.setWidth("150px")
for example but I cannot seem to adjust the height so that if I use grid.addThemeVariants(GridVariant.LUMO_COMPACT)
it will render the rows in a compact manner. No matter what I do the rows seem to be rendered at their normal height.
UPDATE - Just to add it appears to be the vaadin-grid-cell-content that has the extra padding. Using a smaller button helps but there's still too much padding for the column with the button. I'm not sure how to adjust that for the column with the edit/save buttons.