I am trying to make a grid take up as little space as possible, but only grow to a maximum height.
In the case of grid.setHeightByRows(false)
the grid always has a minimum size, even though it may be empty.
When using grid.setHeightByRows(true)
the grid grows as expected, but I have found no way to limit the maximum height of the grid and make it scrollable if it exceeds a certain height.
Is there any way to achieve this behaviour with the Vaadin grid?
Sorry to revive this thread, but I have the same question.
Is it possible?
I’m also interested
You need to set grid.setHeightByRows(true)
and set CSS max-height
for HTML-Element with id=table in your grid theme.
<dom-module id="my-grid-style", theme-for="vaadin-grid">
<template>
<style>
#table {
max-height: *yourValue*;
}
</style>
</template>
</dom-module>