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

PanelBar Bug changing Title?

3 Answers 189 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 23 Jun 2015, 02:40 AM

I can change any title of a panel like this

                               //var li = panelbar.wrapper.find("> li:first span.k-link.k-header");
                                var li = panelbar.wrapper.find("> li:nth(1) span.k-link.k-header");
                                li.contents().first().replaceWith("New Name");

 

But it does not work if the paenlBar contains this a .Content(@<text> </text>); in the parent panel bars.

  @(Html.Kendo().PanelBar()
            .Name("panelbar")

              .Items(panelbar =>
         {
             panelbar.Add().Text("First Person")

                  .Content(@<text>

                    @Html.TextBoxFor(m => m.firstName, new { @class = "input k-textbox"})

                </text>);

         })

)

Why is this?

Thanks

 

 

3 Answers, 1 is accepted

Sort by
0
Genady Sergeev
Telerik team
answered on 23 Jun 2015, 11:13 AM
Hello Andrey,

You can use the following snippet to modify the header when using <text> rendering:

panelbar.wrapper.find(".k-header:first").text("foo")

Regards,
Genady Sergeev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Andrew
Top achievements
Rank 1
answered on 23 Jun 2015, 08:33 PM

Thank you that works great for the first header. How do I access the second and third...etc. 

I tried this and it updates all panels?

panelbar.wrapper.find(".k-header:nth-child(1)").text("foo")

0
Andrew
Top achievements
Rank 1
answered on 24 Jun 2015, 04:11 AM

Been able to update the title from the currently selected panel would do what I require?

Thank you

Tags
PanelBar
Asked by
Andrew
Top achievements
Rank 1
Answers by
Genady Sergeev
Telerik team
Andrew
Top achievements
Rank 1
Share this question
or