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.
Copy to Codepen
Apply
Reset
var DemoApp = angular.module('DemoApp', ['dx']); DemoApp.controller('DemoController', function DemoController($scope) { var showSubmenuModes = [{ name: "onHover", delay: { show: 0, hide: 500 } }, { name: "onClick", delay: { show: 0, hide: 300 } }]; $scope.showFirstSubmenuMode = showSubmenuModes[1]; $scope.orientation = "horizontal"; $scope.submenuDirection = "auto"; $scope.closeOnMouseLeave = false; $scope.productName = "", $scope.productPrice = "", $scope.productImage = ""; $scope.menuOptions = { dataSource: menuData, displayExpr: "name", onItemClick: function (data) { var item = data.itemData; if(item.price) { $scope.productName = item.name; $scope.productPrice = "$" + item.price; $scope.productImage = item.iconSrc; } }, bindingOptions: { showFirstSubmenuMode: "showFirstSubmenuMode", orientation: "orientation", submenuDirection: "submenuDirection", hideSubmenuOnMouseLeave: "closeOnMouseLeave" } }; $scope.submenuModeOptions = { items: showSubmenuModes, displayExpr: "name", bindingOptions: { value: "showFirstSubmenuMode" } }; $scope.orientationOptions = { items: ["horizontal", "vertical"], bindingOptions: { value: "orientation" } }; $scope.submenuDirectionOptions = { items: ["auto", "rightOrBottom", "leftOrTop"], bindingOptions: { value: "submenuDirection" } }; $scope.mouseLeaveOptions = { text: "Hide Submenu on Mouse Leave", bindingOptions: { value: "closeOnMouseLeave" } }; });
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title>DevExtreme Demo</title> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" /> <script src="js/jquery-3.1.0.min.js"></script> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/16.2.5/css/dx.spa.css" /> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/16.2.5/css/dx.common.css" /> <link rel="dx-theme" data-theme="generic.light" href="https://cdn3.devexpress.com/jslib/16.2.5/css/dx.light.css" /> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.16/angular.min.js"></script> <script>window.angular || document.write(decodeURIComponent('%3Cscript src="js/angular.min.js"%3E%3C\/script%3E'))</script> <script src="https://cdn3.devexpress.com/jslib/16.2.5/js/dx.all.js"></script> <script src="data.js"></script> <link rel="stylesheet" type ="text/css" href ="styles.css" /> <script src="index.js"></script> </head> <body class="dx-viewport"> <div class="demo-container" ng-app="DemoApp" ng-controller="DemoController"> <div class="form"> <div> <div class="label">Catalog:</div> <div dx-menu="menuOptions"> </div> <div id="product-details" ng-if="productPrice"> <img ng-src="{{productImage}}" /> <div class="name">{{productName}}</div> <div class="price">{{productPrice}}</div> </div> </div> <div class="options"> <h4>Menu Options</h4> <div> <div>Show First Submenu Mode</div> <div dx-select-box="submenuModeOptions"> </div> </div> <div> <div>Orientation</div> <div dx-select-box="orientationOptions"> </div> </div> <div> <div>Submenu Direction</div> <div dx-select-box="submenuDirectionOptions"> </div> </div> <div> <div dx-check-box="mouseLeaveOptions"></div> </div> </div> </div> </div> </body> </html>
.form > div { display: inline-block; } .form > div:first-child { width: 420px; } .label { font-size: 22px; } #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; }
var menuData = [{ id: "1", name: "Video Players", items: [{ id: "1_1", name: "HD Video Player", price: 220, iconSrc: "../../../../images/products/1.png" }, { id: "1_2", name: "SuperHD Video Player", iconSrc: "../../../../images/products/2.png", price: 270 }] }, { id: "2", name: "Televisions", items: [{ id: "2_1", name: "SuperLCD 42", iconSrc: "../../../../images/products/7.png", price: 1200 }, { id: "2_2", name: "SuperLED 42", iconSrc: "../../../../images/products/5.png", price: 1450 }, { id: "2_3", name: "SuperLED 50", iconSrc: "../../../../images/products/4.png", price: 1600 }, { id: "2_4", name: "SuperLCD 55 (Not available)", iconSrc: "../../../../images/products/6.png", price: 1350, disabled: true }, { id: "2_5", name: "SuperLCD 70", iconSrc: "../../../../images/products/9.png", price: 4000 }] }, { id: "3", name: "Monitors", items: [{ id: "3_1", name: "19\"", items: [{ id: "3_1_1", name: "DesktopLCD 19", iconSrc: "../../../../images/products/10.png", price: 160 }] }, { id: "3_2", name: "21\"", items: [{ id: "3_2_1", name: "DesktopLCD 21", iconSrc: "../../../../images/products/12.png", price: 170 }, { id: "3_2_2", name: "DesktopLED 21", iconSrc: "../../../../images/products/13.png", price: 175 }] }] }, { id: "4", name: "Projectors", items: [{ id: "4_1", name: "Projector Plus", iconSrc: "../../../../images/products/14.png", price: 550 }, { id: "4_2", name: "Projector PlusHD", iconSrc: "../../../../images/products/15.png", price: 750 }] }];