SubItems disabled mini-mode

1 Answer 22 Views
Drawer Drawing API Menu
Dayan K
Top achievements
Rank 1
Dayan K asked on 27 Apr 2022, 10:49 AM | edited on 28 Apr 2022, 06:42 AM

Hi everyone, I would like to ask for your help.
I would like to hide the SubItems when the drawer is in mini mode, if I click on each element.

Thanks in Advance

https://dojo.telerik.com/ejapuWiB/3

Dayan K

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Nikolay
Telerik team
answered on 02 May 2022, 08:52 AM

Hi Dayan,

You need to add a logic to hide the subitems and change the arrow icons on the toggleDrawer() function:

    function toggleDrawer() {
      var drawerInstance = $("#drawer").data().kendoDrawer;
      var drawerContainer = drawerInstance.drawerContainer;

      var itemsAll = $('#drawer li.k-drawer-item')
      var subItems = $('#drawer li.subItem.k-drawer-item')
      subItems.each(function(idx, item) {
        if(!$(item).hasClass("hidden")) {
          $(item).addClass("hidden")
        }
      })

      itemsAll.each(function(idx, item) {
        var collapseIcon = $(item).find("span.k-i-arrow-chevron-down");
        collapseIcon.addClass("k-i-arrow-chevron-right").removeClass("k-i-arrow-chevron-down");
      })

      if (drawerContainer.hasClass("k-drawer-expanded")) {
        drawerInstance.hide();                

      } else {
        drawerInstance.show();
      }
    }

Updated Dojo demo: https://dojo.telerik.com/ejapuWiB/4

Let me know if this is what you are looking for.

Regards,
Nikolay
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Dayan K
Top achievements
Rank 1
commented on 03 May 2022, 06:46 AM

Thanks a lot for your help.
The problem was resolved
Nikolay
Telerik team
commented on 06 May 2022, 06:28 AM

Hi Dayan,

I am happy to hear my suggestion has helped you move forward.

Please let us know if anything new arises.

Regards,

Nikolay

Tags
Drawer Drawing API Menu
Asked by
Dayan K
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or