Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Vaadin grid, additional header renders other headers invisible
Situation: Assume you have a simple grid, with only 2 columns. First column is frozen. You're trying to join the 2nd column with additional header.
Problem: after joining the column, the column captions (in the header cells) of all columns disappear.
Code to reproduce:
Grid table = new Grid(); HeaderRow header = table.addHeaderRowAt(0); Column c1 = table.addColumn("C1", String.class); table.setFrozenColumnCount(1); Column d1 = table.addColumn("D1", Short.class); c1.setHeaderCaption("Frozen col"); d1.setHeaderCaption("1/10"); header.join("D1"); table.addRow("Example name", (short)25);
Results of grids with and without join are in the attachement.
Am I doing something wrong or this is a Vaadin bug?
Vaadin version: 7.7.0
P.S. related question on stackoverflow
You could join the columns such as:
You misunderstood. My intention is to join only one column, in other words just add a header with a caption for only one column.
The underlying reason for it: columns are dynamically generated (there can be 15 of them -> can be joined and works like a charm; if there's only 1 column after dynamic generation -> result above).
I would expect Vaadin to treat this 1 column the same way as 10 columns, i.e. just by adding a header above with a caption.