This is a migrated thread and some comments may be shown as answers.

ExpandMode Singele but allow close

6 Answers 288 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Marcin
Top achievements
Rank 1
Veteran
Marcin asked on 29 Sep 2016, 12:19 PM

Hello

I would ask about possibility to close last panel when expandmode is single. Multiple expand mode allows close all panels, single not.

How to close all panels in single mode.

 

6 Answers, 1 is accepted

Sort by
0
Accepted
Eduardo Serra
Telerik team
answered on 29 Sep 2016, 06:08 PM
Hello Marcin,

We can achieve this behavior by subscribing to the select event and, once it's triggered, checking if the selected panel is the active one and then using the collapse method.

I have prepared a sample for you in the Kendo UI Dojo that follows this approach; you can take a look at it here.

I hope this helps!

Regards,
Eduardo Serra
Telerik by Progress
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
0
Stuart
Top achievements
Rank 1
answered on 21 Mar 2018, 01:13 PM

I tried this, but now I have lost the ability to expand the item?

Stu

0
Ivan Danchev
Telerik team
answered on 22 Mar 2018, 09:07 AM
Hi Stu,

I checked how the PanelBar from the dojo example Eduardo has posted (updated to use the latest official Kendo UI version) behaves and as can be seen in this screencast the item can be collapsed and then expanded. Could you modify the example accordingly so that it demonstrates the issue you are experiencing and link it back for further review?

Regards,
Ivan Danchev
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Stuart
Top achievements
Rank 1
answered on 22 Mar 2018, 10:58 AM

Hi Ivan,

because of the other code on my sharepoint page, I implemented it like so 

$("#panelbar").kendoPanelBar({
     expandMode:"single",
     select:function (e) {
        if ($(e.item).is(".k-state-active")) {
         var that = this;
         window.setTimeout(function(){that.collapse(e.item);}, 1);
        }
      }
     });

 

and that is now working :)

Thanks

 

0
Kishore Kumar
Top achievements
Rank 1
Veteran
answered on 01 Apr 2020, 09:05 AM
how can we achieve the same operation in angular ?
0
Ivan Danchev
Telerik team
answered on 03 Apr 2020, 07:44 AM

Hi Kishore,

For questions on Kendo UI for Angular components, please open a thread in the Kendo UI for Angular forums: https://www.telerik.com/forums/kendo-angular-ui/panelbar

Regards,
Ivan Danchev
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
PanelBar
Asked by
Marcin
Top achievements
Rank 1
Veteran
Answers by
Eduardo Serra
Telerik team
Stuart
Top achievements
Rank 1
Ivan Danchev
Telerik team
Kishore Kumar
Top achievements
Rank 1
Veteran
Share this question
or