Treetable last column fillspace: don't shrink column width

Hi there!
Please, check this example:
When total width of all columns is less then container width - than last column is expanded to fill available space. Which is the desired behavior.
However, if total width of all columns is greater than container width - than I do not want the last column to shrink. I need it to stay the same width I specified in init config. Also I can not use ‘minWidth’ for this purpose, as I need my column to be resizable to smaller width.
Can you advice anything?

Hello there :slight_smile:

Well, it’s a bit of a puzzle.

To some extent, you can try something like this: Code Snippet set fillspace for the column + set minWidth for the table. This will kill the x-scroll of the table, so you can put the table in a scrollview, but there are issues with the scroll: it doesn’t work unless the pointer is on the scroll bar.

If this is an issue, you can try a more complex logic.

  1. for initialization, add fillspace and minWidth for the column
  2. after rendering, the column will get width, which is the real rendered width of the column
  3. remove fillspace and minWidth from the column
  4. you can use resizers as you please
  5. after resizing, if the container is wider than the sum of all columns, add fillspace. the column will resize.
  6. remove fillspace

As an alternative, you can calculate the width on your own all the time.