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"> <div class="caption">Options</div> <div class="option"> <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 class="option"> <div>Orientation</div> @(Html.DevExtreme().SelectBox() .DataSource(new string[] { "horizontal", "vertical" }) .Value("horizontal") .OnValueChanged("menuOrientation_changed") ) </div> <div class="option"> <div>Submenu Direction</div> @(Html.DevExtreme().SelectBox() .DataSource(new string[] { "auto", "rightOrBottom", "leftOrTop" }) .Value("auto") .OnValueChanged("menuDirection_changed") ) </div> <div class="option"> @(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:first-child { margin-right: 320px; } .label { font-size: 22px; } #product-details { width: 400px; height: 400px; margin: 20px auto 0; } #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: 20px; position: absolute; bottom: 0; right: 0; width: 260px; top: 0; background-color: #f5f5f5; } .option { margin-top: 10px; } .caption { font-size: 18px; font-weight: 500; } .hidden { visibility: hidden; }