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

[Solved] Expand/Collapse PanelBar from JQuery Script

1 Answer 42 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
John
Top achievements
Rank 1
John asked on 30 Aug 2012, 09:08 PM

I'm trying to dynamically expand/collpase Telerik Panel bar from Jquery (onload)
Using  jquery-1.7.1.min.js script file reference  

I'm getting error when  I try to use the following code (reason is .element is undefined), Could you please assist me?


function expandPanel(){
      var panelBar  = $("#PanelBar").data("tPanelBar");
      var item = ("> li",panelBar.element)[0];
      panelBar.expand(item);
}


$(document).ready(function () {
expandPanel();
}

1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 04 Sep 2012, 09:00 AM
Hello Chris,

Your code looks completely valid. I suspect you are loading the jQuery mutiple times in your page and this causes the data of the PanelBar client object to be cleared.
Make sure you load only once the jQuery script or share your layout page code and current view code so we can take a look.

Regards,
Petur Subev
the Telerik team
Check out the successor of Telerik MVC Extensions - Kendo UI for ASP.NET MVC - and deem it for new ASP.NET MVC development.
Tags
PanelBar
Asked by
John
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or