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

Need to set a tooltip on a client-side created menu

2 Answers 95 Views
Menu
This is a migrated thread and some comments may be shown as answers.
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
sitefinitysteve asked on 16 Dec 2010, 09:06 PM
How can I create a tooltip on a menu item?

Here's how I'm creating the menu right now...
for(var i=0; i< menuItems.length; i++){
                    var item = menuItems[i];   
                 
                    var newItem = new Telerik.Web.UI.RadMenuItem(); //Create a new Menu Item
                    newItem.set_text(item.Text);
                    newItem.set_value(item.Value);
                    newItem.set_expandMode(item.ExpandMode);
                    newItem.set_navigateUrl(item.NavigateUrl);
 
                    _menu.get_items().add(newItem); //Add the item to the collection
                }

2 Answers, 1 is accepted

Sort by
0
Accepted
Cori
Top achievements
Rank 2
answered on 17 Dec 2010, 02:39 PM
Hello Steve,

This is how you would set the tooltip for the menu item:

newItem.get_element().title = "Tooltip";

I hope that helps.
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 17 Dec 2010, 03:40 PM
Doesn't seem to work, I assume becasue the element hasn't yet been added to the menu (so it's not a physical element yet)

newItem.get_element() is null

**EDIT** works after the add, thanks
Tags
Menu
Asked by
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Answers by
Cori
Top achievements
Rank 2
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Share this question
or