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

Not able to set text on radpanelitem clientside when item is expanding/collapsing

1 Answer 22 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Jan Pfeffer
Top achievements
Rank 1
Jan Pfeffer asked on 30 Jan 2013, 10:41 AM
Hey at Telerik

I am trying to set the text of a radpanelitem when the item is either expanding or collapsing.

I have set the a text on the value attribute and i would like to switch the text to nothing when the item is collapsed and the text from the value attribute when the item is expanded.

I use the method set_text, but it doesn't seem to work.

I have attached a sample project showing my problem here.
http://kort2.lifa.dk/Examples/RadPanelBarClientsideSetTextIssue.rar

I hope u can help me.

Sincerly Jan

1 Answer, 1 is accepted

Sort by
0
Accepted
Kate
Telerik team
answered on 01 Feb 2013, 12:47 PM
Hello Jan,

You can use the following line of code in order to get the desired functionality of the RadPanelBar:
function rpbPlaygroundClientItemExpand(sender, eventArgs) {
               var radMenuItem = eventArgs.get_item();
               var value = eventArgs.get_item().get_value();
               radMenuItem.set_text(value);
               $telerik.$(".rpText").css("display", "inherit");
           }
           function rpbPlaygroundClientItemCollapse(sender, eventArgs) {
               eventArgs.get_item().set_text("");
           }

Regards,
Kate
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
PanelBar
Asked by
Jan Pfeffer
Top achievements
Rank 1
Answers by
Kate
Telerik team
Share this question
or