i created a tree grid. it has a couple of columns, the first being the actual tree and the subsequent ones just data to display. i do not have auto width set (that seemed to cause me more problems than those it fixed). i set the initial column widths to “*”, “20”, “20”, etc. i also have smart rendering on.
the div on which i created the tree grid currently has a parent that has a specified width (e.g., 100px). for example:
// treeroot
// parent
when the grid displays i see all of my columns. the width of the grid appears to be sized as 100px (the width of the parent). however, as i drill down my tree, the deeper i get … the text of my nodes get cut off and i eventually can no longer see my nodes.
what i really need is for the width of the grid control to be sized such that all data can be seen and then have a horizontal scroll bar if necessary to see all of the content.
if i change the width of id=parent to 100%, it becomes screen width and is too wide most of the time.
what do i need to do to allow the tree grid to simply size it’s width as wide as necessary? i’ve spent days on this and am at wits end.
thanks but that didn’t help. it actually made things worse.
i have 2 views of my grid. one in which all of my columns are visible (view a) and one in which only the tree column is visible (view b). using “*” for the initial tree width, view b shows the tree in all of the available space (up to 100px) and view a shows as much as it can giving the other columns the space they said they need (e.g., 20px each).
using a number for the initial tree width (e.g., 10000), view a and b end up being identical. in other words, for view b instead of using all 100px for the tree, it reserves space for the columns that are supposed to be hidden and only displays the tree in the leftover space.
What version of TreeGrid do you use?
Note, column with (*) width occupy all available space from grid container. If all width has been arealy allocated with other columns, such column will not be visible. You can use setColumnMinWidth(width, ind) method to set minimum column width docs.dhtmlx.com/doku.php?id=dhtm … mnminwidth
i tried this and it also doesn’t seem to work. i put a reasonable and ridiculously large number in for the initial and minimum width for my tree column. in both cases, view b (the one in which all of the other columns should be hidden) seem to reserve space for the hidden columns and i only get a little space for the tree column, regardless of the initial and minimum size i set it to be.
if i increase the width of my parent, i see no change. the div class=objbox has width=100%, the parent div (root div) has width=807px and it appears the tree column + my other 5 columns are squished in the first 20% of the left portion of the display area (assume 6 columns using ~20px each) with 80% blank space to the right of it. even if i do something to cause it to repaint (e.g., collapse / expand node), it doesn’t try to fill the entire area.
my concern with setting minimum width however, is that i don’t know what the minimum width for the tree will be. the text for each node is user-specified. it could be 5-500 characters and the deeper the tree goes, the more width is required.