The TreeList supports responsive web-design by adapting its layout based on the available screen size.
The responsive features of the Kendo UI TreeList for Angular are:
- Responsive columns—Based on the viewport width, the visibility of the TreeList columns toggles.
- Responsive height—Based on the height setting (for example,
"100%"), the TreeList adjusts its size depending on the height of its container.
To control the visibility of the columns, use their
media property. The property accepts valid strings for the
matchMedia browser API and toggles the visibility of the columns based on the media queries.
|The columns are visible when|
|The viewport width is 500px or more.|
|The viewport width is 300px or less.|
|The viewport width is between 500px and 1,200px.|
|The viewport width is more than 320px and the device is in a landscape orientation.|
Using the Bootstrap 4 identifiers is a less flexible approach than declaring the responsive breakpoints. However, the identifiers enable the TreeList to match the Bootstrap TreeList system of the surrounding template.
<div class="col-xs-12 col-md-6"> <kendo-treelist> <kendo-treelist-column media="xs"> <!-- template for xs devices --> </kendo-treelist-column> <kendo-treelist-column media="md"> <!-- template for md devices --> </kendo-treelist-column> </kendo-treelist> </div> <div class="col-xs-12 col-md-6"> <!-- second column --> </div>
You can control the height of the TreeList through the
height CSS property. If the height is set in percentage units, the TreeList adjusts its layout accordingly just like a regular HTML element. In CSS, setting the
height of an element to percentage units requires that its parent element has its
height defined. Because this rule is applied recursively, to make the TreeList fill 100% of the browser window, all elements up to the document root
<html> element must have a height of 100%.