0

I use vaadin-grid and want to use row details view when selecting a row. This works as long as the table has a lot of row. Assume you filter some table data and the table gets smaller

enter image description here

when you select a row you are not able to see the row details view anymore because the grid is too small.

How can I prevent that the grid becomes smaller than a minimal height?

Michael
  • 32,527
  • 49
  • 210
  • 370

1 Answers1

0

You can recalculate grid height inside details generator using your data container. Its not the final solution, however it works perfect for my needs which is dynamicly changing grid height without scrollbar inside.

Grid table...
table.setHeightMode(HeightMode.ROW);
table.setDetailsGenerator(new DetailsGenerator() {

   public Component getDetails(RowReference rowReference) {
      table.setHeightByRows(tableContainer.getItemIds().size() + 4);
      //detalis height is constant so I solve this by adding extra space which equals the size of 4 the rows
      //
      //for filtered container you can use tableContainer.getVisibleItemIds()
   }
}

Hope that help. If u find better solution please post it here. I didnt chech that but what about marking component as dirty inside details generator?

daredesm
  • 597
  • 2
  • 7
  • 22