openui5 icon indicating copy to clipboard operation
openui5 copied to clipboard

sap.ui.table.Table: Column resized too wide with frozen percent-based columns

Open cmastrandrea opened this issue 10 years ago • 7 comments

OpenUI5 version: latest

Browser/version (+device/version): All

Any other tested browsers/devices(OK/FAIL):

URL (minimal example if possible): http://jsbin.com/foromaxate/edit?js,output

User/password (if required and possible - do not post any confidential information here):

Steps to reproduce the problem:

  1. Right-click on Column 1 header and select "Freeze"
  2. Resize Column 2 header
  3. Observe width of resized header

What is the expected result? Expected the width of the resized header to remain the same as when the user completes the resize.

What happens instead? After resizing the column, it expands to the full width of the table and no other columns are visible. In IE 11, this happens to the frozen column as soon as you freeze it.

Any other information? (attach screenshot if possible)

cmastrandrea avatar May 23 '16 13:05 cmastrandrea

Thanks for reporting. Looks like a bug to me. Internal reference: 1670350323

matz3 avatar May 27 '16 14:05 matz3

I'm sure if anyone has had a chance to look into the issue this won't be new information but I have found an another related scenario that exhibits the same behavior.

Looking at some similar issues we've seen with column resize, it does not appear to be specific to %-based column widths. Here is another sample with px-based widths. http://jsbin.com/xutemuragu/edit?output The main thing to highlight in the sample is the sum of columns widths is purposefully less than the table widths.

It seems to be there is a scenario where the Table is trying to recalculate column widths and is trying to scale numbers that don't perfectly add up to 100% or are less than the width of the whole table that has some issues. The calculations Table is performing in Table.prototype._resizeDependentColumns makes sense and looks right but it seems there is something not quite fully accounted for.

nickroth avatar Aug 19 '16 18:08 nickroth

@nickroth thanks for sharing! As of now there is no update to this - sorry 😢 In case you can suggest a solution to this please feel free to create a PR 😉

matz3 avatar Sep 02 '16 13:09 matz3

This is not a bug. Fixed columns should always have a width in absolute units of measure, for example: "6rem" or "100px". The framework does not change the width property depending of the number of fixed columns. If an application allows the user to fix some columns, it and all columns to the left of it should have fixed width.

See https://openui5.hana.ondemand.com/#docs/api/symbols/sap.ui.table.Table.html#getFixedColumnCount

ulasenka avatar Oct 24 '16 11:10 ulasenka

Hi @ulasenka the issue we've highlighted isn't so much about the widths of the fixed columns. If you look at the second JSbin sample I provided you can see all the column widths are in px. If you freeze the first column then try to resize the second, you can observe some unexpected behavior. For example, if I freeze the first column then try to make the second column slightly smaller, the second column will actually get bigger.

Please consider reopening or at least letting us know that there is no intention to fix the problem. Thanks.

nickroth avatar Oct 24 '16 13:10 nickroth

Bug in sap.ui.table.Table.prototype._resizeDependentColumns

ulasenka avatar Oct 25 '16 13:10 ulasenka

Fixes are provided.

ulasenka avatar Nov 14 '16 12:11 ulasenka