Hi,
I'm trying to display a TreeView inside a div. The intention is that the TreeView can take all the available spaces left besides other controls.
HTML (properties on other controls are omitted):
<
div
class
=
"container"
>
<
div
class
=
"topbar"
>
<
div
style
=
"padding-top: 1.03125em"
>
<
kendo-dropdownlist
[data]="configs">
</
kendo-dropdownlist
>
</
div
>
<
div
>
<
kendo-textbox-container
>
<
input
kendoTextBox>
</
kendo-textbox-container
>
</
div
>
</
div
>
<
div
class
=
"maincontent"
>
<
div
>
<
kendo-treeview
[nodes]="data"
textField
=
"text"
kendoTreeViewExpandable kendoTreeViewSelectable
kendoTreeViewHierarchyBinding
childrenField
=
"items"
>
</
kendo-treeview
>
</
div
>
<
div
>
<
kendo-grid
[data]="dwgs"
class
=
"view-container"
></
kendo-grid
>
</
div
>
</
div
>
</
div
>
CSS:
.container {
display
: flex;
flex-
direction
: column;
height
:
100%
;
}
.topbar {
display
: flex;
}
.topbar > div {
flex:
1
;
}
.maincontent {
display
: flex;
flex:
1
;
}
.maincontent > div {
flex:
1
;
padding
:
0.5em
0
;
}
.view-container {
height
:
100%
;
}
The problem is when tree node is expanded, when the total height exceeds the available heights, it seems the <ul> DOM inside kendo-treeview will extends the height of kendo-treeview and so does the div wrapping it. As a result the scroll bar of the outer most div (class="container") is enabled, instead of the scroll bar of kendo-treeview itself. This leads to that the whole section to be scrolled but not tree view only. I've tried many css settings but failed to restrict the scroll bar to be inside tree view only. The scroll bar of the tree view will be shown only when the height of the kendo-treeview is set fixed as px, which I don't want to since I prefer it to be self-adjusted.
So how should I make the tree view scroll bar to work instead of triggering the scroll bar of the outer most div?
Thanks in advance.