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

Expand then select/open first sub-panel

2 Answers 104 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Clint
Top achievements
Rank 1
Clint asked on 04 Sep 2014, 12:39 PM
I'm expanding a panelbar based on text from another element, which is easy enough.

var li = $("#panel").find("span.k-header:contains('" + _txt + "')").closest("li.k-item");
$("#panel").data("kendoPanelBar").expand(li);

Now, how do select/open the first child panel under it?

2 Answers, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 04 Sep 2014, 01:34 PM
Hello Clint,


You could retrieve the underlying items for the current one and again invoke the expand (or select) method.
E.g.
va pb = $("#panel").data("kendoPanelBar");
var li = pb.wrapper.find("span.k-header:contains('" + _txt + "')").closest("li.k-item");
var subitem = li.find(">.k-group>.k-item:first");
pb.expand(li);
pb.select(subitem);

Have a great day!

Regards,
Dimiter Madjarov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Clint
Top achievements
Rank 1
answered on 04 Sep 2014, 01:40 PM
Excellent!  Thanks.  I just couldn't quite get the syntax right.  I know it's not directly a kendoui question, more of a jquery question, but I appreciate the assistance!
Tags
PanelBar
Asked by
Clint
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Clint
Top achievements
Rank 1
Share this question
or