I have a table which uses autosizing of all columns (no explicit setWidth()) and it shows up like expected. The colums are either sized after column header or column content, based on which is wider than the other. This is what I want.
But as soon as I set Table.setSortContainerPropertyId(acolumn) the specified column (and only that one) gets resized to the column content. Even if the header is much wider than the column content. Much worse: it should be even larger with the sort order indicator.
The browser does not matter as it doesn't seem to be a rendering issue.
The header's
element style gets set (for example) to 150px when no ordering takes place.
It gets set to 46px when ordering takes place:
.
Just to make sure: If you do not set Table.setSortContainerPropertyId() and let the user click on the column to manually set the ordering, the column remains at it's initial size. Only setting it in code shows the weired behaviour.
The attached project demonstrates the issue.
___
Imported from https://dev.vaadin.com/ issue #12951
Just want to clarify that the problem only occurs if the sorting with Table.setSortContainerPropertyId(propertyId) is done at the same time when the Table gets rendered for the first time. Calling it for a Table that has already been rendered doesn't reproduce the issue.
Originally by lohmann@zad-northeim.de
See https://vaadin.com/pro/support#362 based on https://vaadin.com/forum#!/thread/4308279
I have a table which uses autosizing of all columns (no explicit setWidth()) and it shows up like expected. The colums are either sized after column header or column content, based on which is wider than the other. This is what I want. But as soon as I set Table.setSortContainerPropertyId(acolumn) the specified column (and only that one) gets resized to the column content. Even if the header is much wider than the column content. Much worse: it should be even larger with the sort order indicator.
The browser does not matter as it doesn't seem to be a rendering issue. The header's
Originally by lohmann@zad-northeim.de
Attachment added:
TestProject.zip
(9.3 KiB)Originally by @pleku
Just want to clarify that the problem only occurs if the sorting with
Table.setSortContainerPropertyId(propertyId)
is done at the same time when the Table gets rendered for the first time. Calling it for a Table that has already been rendered doesn't reproduce the issue.Originally by @Artur-
This seems to have been laying here for quite some while because of broken email notifications. Sorry about that.
Originally by @hesara
Confirmed the issue with this slightly shorter test, Vaadin 7.1.11
Originally by g-land
This seems to happen also in 7.5.3. Is there any workaround ?
Originally by g-land
if you sort by some column then remove all the rows and add new rows, the column header is shrinked even without calling setSortContainerPropertyId