You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/controls/drawer/hierarchy.md
+24-23Lines changed: 24 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,47 +14,48 @@ The Kendo UI Drawer provides the built-in functionality to create a hierarchical
14
14
15
15
To utilize the hierarchy functionality of the Kendo UI Drawer:
16
16
17
-
1. Add list elements with data-role attribute `drawer-item` and class `hidden` to the drawer [`template`](/api/javascript/ui/drawer/configuration/template).
17
+
1. Add list elements with data-role attribute `drawer-item` and class `hidden` to the drawer [`template`](/api/javascript/ui/drawer/configuration/template). Use the `data-level` attribute to specify the hierarchy level of each item.
<li data-role='drawer-item' data-level='0'>${kendo.ui.icon("star")}<span class='k-item-text' data-id='Popular'>Most popular components</span></li>
32
+
</ul>`,
33
33
});
34
34
```
35
35
36
+
The hierarchy levels are determined by the Kendo themes and currently support levels from `0` to `5`. If no `data-level` attribute is specified, the Drawer will automatically set it to `0`. Setting`data-level='6'` or higher will have no visual effect as only levels 0-5 are styled by the themes.
37
+
36
38
1. In the [`itemClick`](/api/javascript/ui/drawer/events/itemclick) eventof the drawer handle the expansion and collapse of the hierarchical items.
37
39
38
40
```javascript
39
41
$("#drawer").kendoDrawer({
40
-
itemClick: function (e) {
42
+
itemClick: (e) => {
41
43
if (!e.item.hasClass("k-drawer-separator")) {
42
44
var drawerContainer = e.sender.drawerContainer;
43
-
var expandIcon = e.item.find("span.k-i-arrow-chevron-right");
44
-
var collapseIcon = e.item.find("span.k-i-arrow-chevron-down");
0 commit comments