HtmlAttributes for class and title issue

2 posts, 0 answers
  1. Aldo
    Aldo avatar
    46 posts
    Member since:
    Feb 2011

    Posted 21 Jun 2013 Link to this post

    I've a menu like this
          .HtmlAttributes(new { style = "width: 140px;" })
          .Items(items =>
                foreach (ns.Models.GroupModel item in groups)
                        .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!");
    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'
  2. Iliana Nikolova
    Iliana Nikolova avatar
    2622 posts

    Posted 25 Jun 2013 Link to this post

    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.

    Iliana Nikolova
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top