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

Submenus Not Expanding

4 Answers 224 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Aron
Top achievements
Rank 1
Aron asked on 28 Oct 2012, 04:45 PM

Menu items #1 "Admin Home" and #5 "Help" work fine, but #2, 3 & 4 with submenus are not expanding.

@(Html.Kendo().Menu()
.Name("AdminMenu")
.OpenOnClick(true)
.Items(items =>
{
    items.Add().Text("Admin Home")
          .ImageUrl(Url.Content("~/Content/icons/baseball.png"))
          .HtmlAttributes(new { style = "width:170px" })
          .ImageUrl("~/Content/Icons/ajax.png")
          .Action("Index", "Admin");
 
    items.Add().Text("Manage")
         .ImageUrl(Url.Content("~/Content/icons/golf.png"))
         .HtmlAttributes(new { style = "width:170px" })
         .Items(children =>
         {
             children.Add().Text("Donors").ImageUrl("~/Content/Icons/rep.png").Action("ManageDonors", "Admin");
             children.Add().Text("Recipients").ImageUrl("~/Content/Icons/sitefinity.png").Action("ManageRecipients", "Admin");
             children.Add().Text("Friends").ImageUrl("~/Content/Icons/test.png").Action("ManageFriends", "Admin");
             children.Add().Text("Admin Guys").ImageUrl("~/Content/Icons/win.png").Action("ManageAdmin", "Admin");
             children.Add().Text("Password Reset").ImageUrl("~/Content/Icons/wpf.png").Action("PasswordReset", "Admin");
         });
 
    items.Add().Text("Marketing")
         .ImageUrl(Url.Content("~/Content/icons/golf.png"))
         .HtmlAttributes(new { style = "width:170px" })
         .Items(children =>
         {
             children.Add().Text("Email").ImageUrl("~/Content/Icons/rep.png").Action("ManageFriends", "Admin");
             children.Add().Text("Newsletter").ImageUrl("~/Content/Icons/sitefinity.png").Action("Newsletter", "Admin");
             children.Add().Text("Announcements").ImageUrl("~/Content/Icons/test.png").Action("Announcements", "Admin");
             children.Add().Text("New Members").ImageUrl("~/Content/Icons/win.png").Action("NewMembers", "Admin");
             children.Add().Text("Current Web Site").Url("http://www.life-renewal.org");
         });
 
    items.Add().Text("My Mail")
         .ImageUrl(Url.Content("~/Content/icons/golf.png"))
         .HtmlAttributes(new { style = "width:170px" })
         .Items(children =>
         {
             children.Add().Text("Email").ImageUrl("~/Content/Icons/rep.png").Action("MyMail", "Admin");
             children.Add().Text("Tasks").ImageUrl("~/Content/Icons/sitefinity.png").Action("MyTasks", "Admin");
             children.Add().Text("Calendar").ImageUrl("~/Content/Icons/test.png").Action("MyCalendar", "Admin");
 
         });
 
    items.Add().Text("Help")
          .Action("Help", "Admin")
          .HtmlAttributes(new { style = "width:170px" })
          .ImageUrl("~/Content/Icons/wpf.png");
 
}))

4 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 30 Oct 2012, 12:36 PM
Hi Aron,

Your Menu declaration works correctly on my side. Please don't forget you have set .OpenOnClick(true)

Regards,
Dimo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Aron
Top achievements
Rank 1
answered on 30 Oct 2012, 08:36 PM
Thanks for responding.  I changed the parameter to false, but it is still not working.  Here is the entire page:

<!DOCTYPE html>
 
<html>
<head>
    <meta name="viewport" content="width=device-width" />
        <meta charset="utf-8" />
    <title>@ViewBag.Title</title>
        <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
        <meta name="viewport" content="width=device-width" />
        @Styles.Render("~/Content/css")
        @Scripts.Render("~/bundles/modernizr")
        <link href="@Url.Content("~/Content/kendo/2012.2.913/kendo.common.min.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/kendo/2012.2.913/kendo.dataviz.min.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/kendo/2012.2.913/kendo.metro.min.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/kendo/2012.2.913/jquery.min.js")"></script>
    <script src="@Url.Content("~/Scripts/kendo/2012.2.913/kendo.all.min.js")"></script>
    <script src="@Url.Content("~/Scripts/kendo/2012.2.913/kendo.aspnetmvc.min.js")"></script>
 
</head>
    <body>
        <header>
            <div class="content-wrapper">
                <div class="float-left">
                    <p class="site-title">
                        <a href='@Url.Action("Index", "Home")'>
                        <img src='@Url.Content("~/Images/renewal_logo.gif")' /></a>
                </div>
                <div class="float-right">
                    <section id="login">
                        @Html.Partial("_LoginPartial")
                    </section>
                    <nav>
          @(Html.Kendo().Menu()
          .Name("AdminMenu")
          .OpenOnClick(false)
          .HighlightPath(true)
          .Animation(true)
          .Items(items =>
          {
              items.Add().Text("Admin Home")
                    .ImageUrl("~/Content/Icons/ajax.png")
                    .HtmlAttributes(new { style = "width:170px" })
                    .Action("Index", "Admin");
 
              items.Add().Text("Manage")
                   .ImageUrl(Url.Content("~/Content/icons/mvc.png"))
                   .HtmlAttributes(new { style = "width:170px" })
                   .Items(children =>
                   {
                       children.Add().Text("Donors").ImageUrl("~/Content/Icons/rep.png").Action("ManageDonors", "Admin");
                       children.Add().Text("Recipients").ImageUrl("~/Content/Icons/sitefinity.png").Action("ManageRecipients", "Admin");
                       children.Add().Text("Friends").ImageUrl("~/Content/Icons/test.png").Action("ManageFriends", "Admin");
                       children.Add().Text("Admin Guys").ImageUrl("~/Content/Icons/win.png").Action("ManageAdmin", "Admin");
                       children.Add().Text("Password Reset").ImageUrl("~/Content/Icons/wpf.png").Action("PasswordReset", "Admin");
                   });
 
              items.Add().Text("Marketing")
                   .ImageUrl(Url.Content("~/Content/icons/sitefinity.png"))
                   .HtmlAttributes(new { style = "width:170px" })
                   .Items(children =>
                   {
                       children.Add().Text("Email").ImageUrl("~/Content/Icons/rep.png").Action("ManageFriends", "Admin");
                       children.Add().Text("Newsletter").ImageUrl("~/Content/Icons/sitefinity.png").Action("Newsletter", "Admin");
                       children.Add().Text("Announcements").ImageUrl("~/Content/Icons/test.png").Action("Announcements", "Admin");
                       children.Add().Text("New Members").ImageUrl("~/Content/Icons/win.png").Action("NewMembers", "Admin");
                       children.Add().Text("Current Web Site").Url("http://www.life-renewal.org");
                   });
 
              items.Add().Text("My Mail")
                   .ImageUrl(Url.Content("~/Content/icons/win.png"))
                   .HtmlAttributes(new { style = "width:170px" })
                   .Items(children =>
                   {
                       children.Add().Text("Email").ImageUrl("~/Content/Icons/rep.png").Action("MyMail", "Admin");
                       children.Add().Text("Tasks").ImageUrl("~/Content/Icons/sitefinity.png").Action("MyTasks", "Admin");
                       children.Add().Text("Calendar").ImageUrl("~/Content/Icons/test.png").Action("MyCalendar", "Admin");
 
                   });
 
              items.Add().Text("Help")
                    .Action("Help", "Admin")
                    .HtmlAttributes(new { style = "width:170px" })
                    .ImageUrl("~/Content/Icons/wpf.png");
 
          }))
                    </nav>
                    <div>@(Html.Kendo().DatePicker().Name("Birthday"))</div>
                </div>
            </div>
        </header>
        <div id="body">
            @RenderSection("featured", required: false)
            <section class="content-wrapper main-content clear-fix">
                @RenderBody()
            </section>
        </div>
        <footer>
            <div class="content-wrapper">
                <div class="float-left">
                    <p>© @DateTime.Now.Year - Renewal Admin Application</p>
                </div>
            </div>
        </footer>
 
        @Scripts.Render("~/bundles/jquery")
        @RenderSection("scripts", required: false)
    </body>
</html>
0
Accepted
Dimo
Telerik team
answered on 31 Oct 2012, 10:35 AM
Hi Aron,

It looks like you are registering two jQuery instances on the page, which deletes all previously registered jQuery plugins, such as the Kendo UI widgets.

Also make sure there are no JS errors on the page.

Greetings,
Dimo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Aron
Top achievements
Rank 1
answered on 31 Oct 2012, 03:04 PM
Thanks for responding.  I removed the 2nd instance and that did it.  Of interest, I did not add either jQuery instance. The first was inserted by Kendo "Configure Project" and the 2nd by VS. 
Tags
Menu
Asked by
Aron
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Aron
Top achievements
Rank 1
Share this question
or