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

ToolTip for Dynamic Menu Items?

2 Answers 67 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 2
Ryan asked on 10 Nov 2008, 11:16 PM
What is the easiest way to add a tooltip for dynamic menu items populated by a web service? You would think there would be a tooltip property on the RadMenuItemData class but there isn't. Suggestions?

Thanks

2 Answers, 1 is accepted

Sort by
0
Accepted
Veselin Vasilev
Telerik team
answered on 13 Nov 2008, 05:02 PM
Hello Ryan,

Add it as a custom attribute in the webservice method and then in OnClientItemPopulated set the title of the textElement to the value of that custom attribute:

function itemPopulated(sender, eventArgs) 
 { 
   var items = eventArgs.get_item().get_items(); 
   for (var i=0; i < items.get_count(); i++) 
   { 
     var item = items.getItem(i); 
     item.get_textElement().title = item.get_attributes().getAttribute("tooltip"); 
   } 
 } 

I hope this helps.

Regards,
Veselin Vasilev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Ryan
Top achievements
Rank 2
answered on 13 Nov 2008, 09:45 PM
That worked great. Thnx!
Tags
Menu
Asked by
Ryan
Top achievements
Rank 2
Answers by
Veselin Vasilev
Telerik team
Ryan
Top achievements
Rank 2
Share this question
or