Horizontal layout with the same size as columns of a table

Hi,

I have a use case where I would like that each column of a table can be filtered by typing a few characters in a dedicated search field. Ideally, I would add these fields in the header itself but it’s not possible in Vaadin (without fixed columns size). See http://dev.vaadin.com/ticket/8432

I have two other candidates in mind in the mean time:

  • Create a fake first row and use this row for my filter (not sure it’s possible but I think it would work)
  • Create an horizontal layout with X text fields (with X columns).

In the second case, how can I make sure the size of my textfield (+ spacing) is exactly equal to the size of the columns?

Any idea on how to achieve this use case?

Thanks,
S.

Hi,

I’ve not done this myself, but I’d start with the
ColumnResizeEvent
, and take it from there.

Cheers,

Charles.

You could check whether the new
FilteringTable add-on
satisfies your requirements.

Ah wonderful ! Thanks Henri. I am using a tree table actually, I am going to look to that plugin to see if we can use it with a tree table and if not, I’ll try to modify it to support this use case.

Thanks. That’s what I’ve done but the original size of the column is not available from the start so it’s a bit messy. The plugin seems a faster solution for my need actually.