Your search did not match any results.
NavBar

NavBar

Documentation
The NavBar is a widget that navigates the application views.
Copy to CodePen
Apply
Reset
window.onload = function() { var viewModel = { navData: navData, navSelectedIndex: ko.observable(0), listData: [{ data: new DevExpress.data.DataSource({ store: contacts, sort: "name" }) }, { data: new DevExpress.data.DataSource({ store: contacts, sort: "name", filter: ["category", "=", "Missed"] }) }, { data: new DevExpress.data.DataSource({ store: contacts, sort: "name", filter: ["category", "=", "Favorites"] }) } ], currentData: ko.observable() }; viewModel.currentData(viewModel.listData[0].data); viewModel.navSelectedIndex.subscribe(function (newValue) { viewModel.currentData(viewModel.listData[newValue].data); }); ko.applyBindings(viewModel, document.getElementById("navbar")); };
<!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> <script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.4.0/knockout-min.js"></script> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/17.1.6/css/dx.spa.css" /> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/17.1.6/css/dx.common.css" /> <link rel="dx-theme" data-theme="generic.light" href="https://cdn3.devexpress.com/jslib/17.1.6/css/dx.light.css" /> <link rel="dx-theme" data-theme="android5.light" href="https://cdn3.devexpress.com/jslib/17.1.6/css/dx.android5.light.css" /> <link rel="dx-theme" data-theme="ios7.default" href="https://cdn3.devexpress.com/jslib/17.1.6/css/dx.ios7.default.css" /> <link rel="dx-theme" data-theme="win10.black" href="https://cdn3.devexpress.com/jslib/17.1.6/css/dx.win10.black.css" /> <link rel="dx-theme" data-theme="win10.white" href="https://cdn3.devexpress.com/jslib/17.1.6/css/dx.win10.white.css" /> <script src="https://cdn3.devexpress.com/jslib/17.1.6/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 id="navbar"> <div data-bind="dxList: { dataSource: currentData }"> <div data-options="dxTemplate: { name: 'item' }"> <div class="image-container"> <img data-bind="attr: { src: image }"> </div> <div class="info"> <div data-bind="text: name"></div> <div data-bind="text: phone"></div> <div data-bind="text: email"></div> </div> </div> </div> <div data-bind="dxNavBar: { dataSource: navData, selectedIndex: navSelectedIndex }"></div> </div> </div> </body> </html>
.dx-list { height: 90%; position: absolute; top: 0; bottom: 0; } .info { margin-top: 5px; height: 78px; } .image-container { width: 65px; float: left; margin-right: 20px; } .image-container img { display: block; width: 100%; } .dx-tabs.dx-navbar { text-align: center; position: absolute; bottom: 0; }
var contacts = [ { name: "Barbara J. Coggins", phone: "512-964-2757", image: "../../../../images/employees/04.png", email: "BarbaraJCoggins@rhyta.com", category: "Favorites" }, { name: "Leslie S. Alcantara", phone: "360-684-1334", image: "../../../../images/employees/01.png", email: "LeslieSAlcantara@teleworm.us", category: "Missed" }, { name: "Chad S. Miles", phone: "520-573-7903", image: "../../../../images/employees/02.png", email: "ChadSMiles@rhyta.com", category: "Favorites" }, { name: "Michael A. Blevins", phone: "530-480-1961", image: "../../../../images/employees/03.png", email: "MichaelABlevins@armyspy.com", category: "Missed" }, { name: "Jane K. Hernandez", phone: "404-781-0805", image: "../../../../images/employees/05.png", email: "JaneKHernandez@teleworm.us", category: "Favorites" }, { name: "Kim D. Thomas", phone: "603-583-9043", image: "../../../../images/employees/06.png", email: "KimDThomas@teleworm.us", category: "Outgoing call" }, { name: "Donald L. Jordan", phone: "772-766-2842", image: "../../../../images/employees/07.png", email: "DonaldLJordan@dayrep.com", category: "Favorites" }, { name: "Nicole A. Rios", phone: "213-812-8400", image: "../../../../images/employees/09.png", email: "NicoleARios@armyspy.com", category: "Missed" }, { name: "Barbara M. Roberts", phone: "614-365-7945", image: "../../../../images/employees/08.png", email: "BarbaraMRoberts@armyspy.com", category: "Outgoing call" } ]; var navData = [{ text: "Contacts", icon: "user" }, { text: "Missed", icon: "clock", badge: 3 }, { text: "Favorites", icon: "favorites" } ];