Book Image

Kendo UI Cookbook

By : Sagar Ganatra
Book Image

Kendo UI Cookbook

By: Sagar Ganatra

Overview of this book

Table of Contents (18 chapters)
Kendo UI Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Customizing the PanelBar


There are a few options available to customize the behavior of the PanelBar widget. In this recipe, we will take a look at setting the expanded mode for the PanelBar widget and the animation effects that can be applied.

How to do it…

The PanelBar widget is designed so that it occupies less space on the page and, at the same time, shows you the necessary content. When you click on any of the list items in the PanelBar widget, it expands to show you the content. Now, when you click on the other list item, it would also expand to show its content. At this stage, there are two items in the PanelBar whose content is being shown. By setting the expandMode property to single, only one item in the list can remain in the expanded state at any given time:

$("#panelBar").kendoPanelBar({
     expandMode: 'single'
});

By default, the value of the expandMode property is multiple and hence the behavior mentioned earlier takes place.

Note

In case the expanded panel contains a nested list...