HtmlAttributes for class and title issue

1 Answer 10137 Views
Menu
Aldo
Top achievements
Rank 2
Aldo asked on 21 Jun 2013, 11:00 AM
Hi,
I've a menu like this
@(Html.Kendo().Menu()
      .Name("grouplist")
      .HtmlAttributes(new { style = "width: 140px;" })
      .Items(items =>
      {
            foreach (ns.Models.GroupModel item in groups)
            {
                items.Add()
                    .Text(item.Name)
                    .HtmlAttributes(new { @class = "menuitem" })
                    //.HtmlAttributes(new { @title = "Items in this group : " + item.Count })
                    .Items(children =>
                    {
                        children.Add().Text("Add new item");
                        children.Add().Text("Edit group");
                        children.Add().Text("Delete group!");
                    });
            }
        })
      .Orientation(MenuOrientation.Vertical))
All works fine if I keep commented the second HtmlAttributes (used to set the tooltip through title), if I uncomment that line, the menu show the tooltip but, uses jquery default style (and not kendo theme) and lost item css class 'menuitem'

1 Answer, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 25 Jun 2013, 10:45 AM
Hello Aldo,

In order to keep both the menuitem  class and the title you should define them in one HtmlAttributes method. I.e.:

//....
.HtmlAttributes(new { @class = "test", @title = "Items in this group : " })
Also you may consider using Kendo UI Tooltip widget to show additional information.

Regards,
Iliana Nikolova
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Menu
Asked by
Aldo
Top achievements
Rank 2
Answers by
Iliana Dyankova
Telerik team
Share this question
or