asp.netasp.net-mvckendo-asp.net-mvckendo-panelbarpanelbar

Rename selected Kendo PanelBar


How would you rename the currently selected PanelBar. I have a select function that works, this method removes the selected panelBar

panelbar.remove(panelbar.select());

This method renames the first PanelBar

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

Tried with no joy

panelbar.wrapper.find(panelbar.select().text("New Text"));
panelbar.wrapper.find(panelbar.select()(".k-header").text("New Text"));

Thank you


Solution

  • Within your fuction

    panelbar.select().find("> .k-link").text("New Text");
    

    Here's a Dojo http://dojo.telerik.com/EDekO/2

    You could do it using the select event e.g.

     @(Html.Kendo().PanelBar()
    .Name("panelbar")
    .Events(events => events.Select("onSelect"))
    

    Then your onSelect function

    function onSelect(e) {
       $(e.item).find("> .k-link").text("New Text");
    }