Im a very annoying with de grid when some variable text exceed the cell width.
Here is a simple example :
We have a grid and the last column should have a variable width that would take all the table width minus the maximum width of other colums
@Override
protected void init(VaadinRequest vaadinRequest) {
final VerticalLayout layout = new VerticalLayout();
layout.setSizeFull();
Grid grid = new Grid();
grid.setSizeFull();
grid.addColumn("Name").setWidth(200).setMaximumWidth(200).setExpandRatio(0);
grid.addColumn("Start").setWidth(130).setMaximumWidth(130).setExpandRatio(0);
grid.addColumn("End").setWidth(130).setMaximumWidth(130).setExpandRatio(0);
//Take all the width left
grid.addColumn("Description").setExpandRatio(1);
grid.addRow("Test", "2017-05-31", "2017-06-30", "Text");
grid.addRow("Test 2", "2017-06-30", "2017-07-31", "A very long text which should be cutted, but in my best wish will appear on multi lines but the grid can't have viarbale row height because of lazy loading i don't need");
layout.addComponent(grid);
setContent(layout);
}
Works fine with small text…
but when we add a row with a long text then the column description has a width equal to the text size.
And then we have a horrible horizontal scrollbar.
(see atachment)