Your search did not match any results.
NavBar

NavBar

NOTE

The NavBar component is deprecated as of v21.1. We recommend that you use the Tabs component instead.

The NavBar is a UI component that navigates the application views.

Backend API
Copy to CodePen
Apply
Reset
$(() => { DevExpress.setTemplateEngine('underscore'); const 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'], }), }, ]; const list = $('#list').dxList({ dataSource: listData[0].data, itemTemplate: $('#item-template'), }).dxList('instance'); $('#navbar').dxNavBar({ dataSource: navData, selectedIndex: 0, onItemClick(e) { list.option('dataSource', listData[e.itemIndex].data); }, }); });
<!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="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script>window.jQuery || document.write(decodeURIComponent('%3Cscript src="js/jquery.min.js"%3E%3C/script%3E'))</script> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/21.2.3/css/dx.common.css" /> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/21.2.3/css/dx.light.css" /> <script src="https://cdn3.devexpress.com/jslib/21.2.3/js/dx.all.js"></script> <script src="js/underscore.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="list"></div> <div id="navbar"></div> <script type="text/html" id="item-template"> <div class="image-container"> <img src="<%= image %>"> </div> <div class="info"> <div><%= name %></div> <div><%= phone %></div> <div><%= email %></div> </div> </div> </script> </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; }
const 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', }, ]; const navData = [{ text: 'Contacts', icon: 'user', }, { text: 'Missed', icon: 'clock', badge: 3, }, { text: 'Favorites', icon: 'favorites', }, ];