Your search did not match any results.
Slideout

Overview

Documentation
The SlideOut widget is a classic slide-out menu paired with a view. A user opens the menu by swiping away the view. This demo shows how to group menu items and how to define custom templates for the view and group headers.
Copy to CodePen
Apply
Reset
$(function(){ function showMenu() { slideOut.option("menuVisible", !slideOut.option("menuVisible")); } var slideOut = $("#slideout").dxSlideOut({ dataSource: products, onItemClick: showMenu, menuVisible: true, swipeEnabled: true, menuGrouped: true, itemTemplate: function(itemData, itemIndex, itemElement) { $("<div/>") .appendTo(itemElement) .dxToolbar({ dataSource: [{ location: "before", widget: "dxButton", options: { icon: "menu", onClick: showMenu } }, { location: "center", template: function(e) { return "<p>" + itemData.text + "</p>"; } }] }); var $infoContainer = $("<div />").attr("id", "info"); $infoContainer.append( $("<img />").attr("src", itemData.src), $("<h1 />").text(itemData.price) ); var $fieldSetContainer = $("<div />").addClass("dx-fieldset"); $fieldSetContainer.append( $("<div />").addClass("dx-fieldset-header").text("Options"), $("<div />").addClass("dx-field").append( $("<div />").addClass("dx-field-label").text("Swipe to reveal the menu"), $("<div />").addClass("dx-field-value switch") ) ); itemElement.append($infoContainer, $fieldSetContainer); $(".switch").dxSwitch({ value: slideOut ? slideOut.option("swipeEnabled") : true, onValueChanged: function(e) { slideOut.option("swipeEnabled", e.value); } }); }, menuGroupTemplate: function(e) { return "<b>" + e.key + "</b>"; } }).dxSlideOut("instance"); });
<!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/17.1.4/css/dx.spa.css" /> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/17.1.4/css/dx.common.css" /> <link rel="dx-theme" data-theme="generic.light" href="https://cdn3.devexpress.com/jslib/17.1.4/css/dx.light.css" /> <link rel="dx-theme" data-theme="android5.light" href="https://cdn3.devexpress.com/jslib/17.1.4/css/dx.android5.light.css" /> <link rel="dx-theme" data-theme="ios7.default" href="https://cdn3.devexpress.com/jslib/17.1.4/css/dx.ios7.default.css" /> <link rel="dx-theme" data-theme="win10.black" href="https://cdn3.devexpress.com/jslib/17.1.4/css/dx.win10.black.css" /> <link rel="dx-theme" data-theme="win10.white" href="https://cdn3.devexpress.com/jslib/17.1.4/css/dx.win10.white.css" /> <script src="https://cdn3.devexpress.com/jslib/17.1.4/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"> <div class="slideout-container"> <div id="slideout"></div> </div> </div> </body> </html>
#info { width: 200px; height: 200px; text-align: center; margin: 0 auto; margin-top: 10px; } #info img { width: 100%; } .slideout-container { height: auto; position: absolute; top: 0; bottom: 0; width:100%; } .dx-field-label { width: 70%; }
var products = [{ key: "Televisions", items: [ { text: "SuperLCD 42", price: "$1200", src: "../../../../images/products/7.png" }, { text: "SuperLED 42", price: "$1450", src: "../../../../images/products/5.png" }, { text: "SuperLED 50", price: "$1600", src: "../../../../images/products/4.png" }, { text: "SuperLCD 55", price: "$1350", src: "../../../../images/products/6.png" }, { text: "SuperLCD 70", price: "$4000", src: "../../../../images/products/9.png" } ] }, { key: "Monitors", items: [ { text: "DesktopLCD 19", price: "$160", src: "../../../../images/products/10.png" }, { text: "DesktopLCD 21", price: "$170", src: "../../../../images/products/12.png" }, { text: "DesktopLED 21", price: "$180", src: "../../../../images/products/13.png" } ] }, { key: "Projectors", items: [ { text: "Projector Plus", price: "$550", src: "../../../../images/products/14.png" }, { text: "Projector PlusHD", price: "$750", src: "../../../../images/products/15.png" } ] }, { key: "Video Players", items: [ { text: "HD Video Player", price: "$220", src: "../../../../images/products/1.png" }, { text: "SuperHD Video Player", price: "$270", src: "../../../../images/products/2.png" } ] } ];