ToolTip for Dynamic Menu Items?

3 posts, 1 answers
  1. Ryan
    Ryan avatar
    2 posts
    Member since:
    Aug 2012

    Posted 10 Nov 2008 Link to this post

    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. Answer
    Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 13 Nov 2008 Link to this post

    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.
  3. Ryan
    Ryan avatar
    2 posts
    Member since:
    Aug 2012

    Posted 13 Nov 2008 Link to this post

    That worked great. Thnx!
Back to Top