TableView icon indicating copy to clipboard operation
TableView copied to clipboard

setColumnWidth() does not seem to do anything immediately

Open anemo-hypostasis opened this issue 5 years ago • 2 comments

Issue

Is there a way to immediately apply setColumnWidth()? In its current state, the column needs to disappear from view in order for the width to be applied.

Attempted solutions

I've already tried requestLayout(), forceLayout(), invalidate(), and a combination of them on the TableView to no avail.

Further info/context

Here's a gif to illustrate. I've set column 3 to 800px using setColumnWidth(), but it does not update until it disappeared from view. ezgif-2-62cac79f30c1

anemo-hypostasis avatar Sep 07 '20 08:09 anemo-hypostasis

I've found that setColumnWidth() only works with indexes based on the actual table, and not my data's index.

For example, I have columns {0, 1, 2, 3, 4}. I hid column 2. The visible columns would then be {0, 1, 3, 4}. If I wanted to resize column 3, I would need to call setColumnWidth(2), where 2 is the visible position of column 3.

Maybe this info helps someone out.

anemo-hypostasis avatar Sep 09 '20 16:09 anemo-hypostasis

Good catch! I've submitted #376 to fix this issue.

MGaetan89 avatar Apr 09 '21 18:04 MGaetan89