Open timomeinen opened 2 months ago
I don't think it makes sense for CRUD to change its own height based on a setting on the Grid, but I suppose we could add API in CRUD for setting all-rows-visible mode that effectively bases its height on the contents of the Grid. Although I feel that such a mode would not make sense with an editor in the bottom or aside position (i.e. I feel that it only really makes sense with an overlay editor).
Thank you @rolfsmeds. Makes sense.
Although, the outer element CRUD must somehow handle the situation that the inner grid enlarges. Otherwise, the grid is simply cutted and the bottom layout is missing. I wonder, if the CRUD should always have height: auto
and rely on the inner grid's default height: 400px
or all-rows-visible mode.
I solved it now like this:
crud.setHeight("auto");
crud.getGrid().setMinHeight(400, Unit.PIXELS);
crud.getGrid().setAllRowsVisible(true);
Description of the bug
Using the CRUD component, I want to
setAllRowsVisible(true)
:This sets
height: auto
on the Grid viaall-rows-visible
. But the grid is then "cutted" at the bottom by the surroundingvaadin-crud
element that has a fixed size ofheight: 400px
.Expected behavior
When enabling
setAllRowsVisible(true)
the CRUD element should also getheight: auto
.Alternatively, write a delegate on CRUD for
setAllRowsVisible(true)
that sets height on CRUD and calls grid'ssetAllRowsVisible(true)
.Minimal reproducible example
Create CRUD with 20 elements of data and call:
Versions