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

[Solved] Problem in expand second node in PanelBar

0 Answers 7 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jignesh
Top achievements
Rank 1
Jignesh asked on 01 Jul 2011, 11:08 AM

Hi ,

I want to expand second node  in PanelBar. When I clicked on button2  then  Node1 is expand but when I clicked on button1 then Node2 is not expand. Please help me how to expand Node2 in Panel Bar.

@{

               Html.Telerik().PanelBar()

                   .Name("PanelBar")

                   .Items(items =>

                   {

                       items.Add()

                          

                           .Text("Node1")

                           .Content(

                                     @<text>

                                                  <input type="button" value="button1" onclick="ExpandItem2()" />

 

                                     </text>

                                   );

                           items.Add()

                          

                           .Text("Node2")

                           .Content(

                                     @<text>

                                       <center>

                                        <input type="button" value="button2" onclick="ExpandItem1()" />

                                      </center>

                                     </text>

                                   );

                     

                     

                   })

     

                     .ExpandMode(PanelBarExpandMode.Single)

                    .Render();

}

 

 

//Expand First Node1

 function ExpandItem1() {

         var panel = $("#PanelBar").data("tPanelBar");

         var item = $("li:first", panel.element)[0];

         panel.expand(item);

            }

// Expand Node2 ,But error in following JavaScript ,

How to expand Node2 from Following Javascript

function ExpandItem2() {

      var panel = $("#PanelBar").data("tPanelBar");

      var item = $("li:second", panel.element)[1];

      panel.expand(item);

            }

 

Tags
General Discussions
Asked by
Jignesh
Top achievements
Rank 1
Share this question
or