Resizing TreeTable ColumnWidths proportionally

Hi,

my treetable fills at the moment its parent container, as I wished. I also would like to have their column-widths proportionally adjusted within the total width. Is there a way to make treetable column-widths to resize automatically and proportionally, also whenever I resize the window?

Examples in the webix documentation show resizing the tree/data table automatically, but that doesn’t trigger an automatic column-resizing… I don’t want to define the column-widths fixed, therefore they get 100px width as default. What I would like to have is, that they get dynamic (proportionally calculated to fill the total available area) resizing…

Is it possible in webix?

Thank you.

PS: A snippet showing that it is possible would be great…

You can use fillspace attribute to one of columns, to fill the space, or you can use code like next

http://webix.com/snippet/4a843234

The good think about webix is that you need not to add such code each time when you need proportional width of columns. You can extend the datatable component once, creating your own view with custom setttings and behaviors, and use such view where necessary. Check the next snippet

http://webix.com/snippet/1227f137

it uses the same code as above one, but now it creates a new view - flextable, which works the same as datatable, but have different column sizing strategy.

thank you very much for your answer maksim!

there are however three problems with the snippet you provided:

  1. empty scroll bars are always shown, even if they are not needed
  2. scroll bars don’t show up when they are needed, i.e. when the window size is too small (smaller than minWidth)
  3. the columns have all the same width initially. i would like to define initial widths or proportions for them, or at least that the “adjust: true” works as intended…

could you please help with this issue further? i think it is not unimportant for many users…

thank you.

Ability to define initial proportions will be added as part of the next build (it will extend the existing “fillspace” property)

great, waiting for it!

please let me know when it’s ready.