Your search did not match any results.
Menu

Overview

Documentation
The Menu widget is a panel with clickable items. A click on an item opens a drop-down menu, which can contain several submenus.
<div class="form"> <div> <div class="label">Catalog:</div> @(Html.DevExtreme().Menu() .ID("menu") .DataSource(d => d.Mvc().Controller("Menu").LoadAction("GetProducts")) .HideSubmenuOnMouseLeave(false) .OnItemClick("menuItem_click") ) <div id="product-details" class="hidden"> <img src="" /> <div class="name"></div> <div class="price"></div> </div> </div> <div class="options"> <h4>Menu Options</h4> <div> <div>Show First Submenu Mode</div> @(Html.DevExtreme().SelectBox() .DataSource(new JS("showSubmenuModes")) .Value(new JS("showSubmenuModes[1]")) .DisplayExpr("name") .OnValueChanged("firstSubMenuMode_changed") ) </div> <div> <div>Orientation</div> @(Html.DevExtreme().SelectBox() .DataSource(new string[] { "horizontal", "vertical" }) .Value("horizontal") .OnValueChanged("menuOrientation_changed") ) </div> <div> <div>Submenu Direction</div> @(Html.DevExtreme().SelectBox() .DataSource(new string[] { "auto", "rightOrBottom", "leftOrTop" }) .Value("auto") .OnValueChanged("menuDirection_changed") ) </div> <div> @(Html.DevExtreme().CheckBox() .Value(false) .Text("Hide Submenu on Mouse Leave") .OnValueChanged("checkBoxValue_changed") ) </div> </div> </div> <script> var showSubmenuModes = [{ name: "onHover", delay: { show: 0, hide: 500 } }, { name: "onClick", delay: { show: 0, hide: 300 } }]; function getMenuInstance() { return $("#menu").dxMenu("instance"); } function menuItem_click(data) { var item = data.itemData; if (item.price) { $("#product-details").removeClass("hidden"); $("#product-details > img").attr("src", item.icon); $("#product-details > .price").text("$" + item.price); $("#product-details > .name").text(item.text); } } function firstSubMenuMode_changed(data) { getMenuInstance().option("showFirstSubmenuMode", data.value); } function menuOrientation_changed(data) { getMenuInstance().option("orientation", data.value); } function menuDirection_changed(data) { getMenuInstance().option("submenuDirection", data.value); } function checkBoxValue_changed(data) { getMenuInstance().option("hideSubmenuOnMouseLeave", data.value); } </script>
.form > div { display: inline-block; } .form > div:first-child { width: 420px; } .label { font-size: 22px; color: inherit; } #product-details { margin-top: 20px; vertical-align: top; width: 400px; height: 400px; } #product-details > img { height: 300px; width: 400px; } #product-details > .name { text-align: center; font-size: 20px; } #product-details > .price { text-align: center; font-size: 24px; } .dark #product-details > div { color: #f0f0f0; } .options { padding-top: 5px; margin-left: 40px; width: 300px; vertical-align: top; } .options > div { margin-top: 25px; } .hidden { visibility: hidden; }