Custom Elements Documentation

Getting Started

jqxNavigationBar is a HTML Element which is similar to tabs, navigationbar has header and content sections. click headers to expand or collapse the content. optionally you can change the default toggle mode to double-click or mouseover.

Every UI element from jQWidgets toolkit needs its JavaScript files to be included in order to work properly.

The first step is to create html page and add links to the javascript files and css dependencies to your project.

The jqxNavigationBar element requires the following files:

<script type="text/javascript" src="../scripts/webcomponents-lite.min.js"></script>
<script type="text/javascript" src="../jqwidgets/jqxcore.js"></script>
<script type="text/javascript" src="../jqwidgets/jqxcore.elements.js"></script>
<script type="text/javascript" src="../jqwidgets/jqxdata.js"></script>
<script type="text/javascript" src="../jqwidgets/jqxnavigationbar.js"></script>
The next step is to add the html element within the body of the html page.

<jqx-navigation-bar settings="elementSettings"></jqx-navigation-bar>
The last step is to initialize the element settings:
<script type="text/javascript">
JQXElements.settings["elementSettings"] =
{
animationType:"fade", theme:"light"
}
</script>
To call a function(method), you need to pass the method name and parameters(if any) in the jqxNavigationBar's instance.
<script>
window.onload = function () {
var element = document.querySelector("jqx-navigation-bar");
element.add(1,'Header','Content');
}
</script>
To get the result of a function after calling it, you can use the following syntax:
<script>
window.onload = function () {
var element = document.querySelector("jqx-navigation-bar");
var result = element.getHeaderContentAt();
}
</script>
To set a property(option), you need to use the property name and value(s) along with the jqxNavigationBar's instance.
window.onload = function() {
document.querySelector("jqx-navigation-bar").animationType = ''slide'';
}
You can also set properties of HTML Elements by using Attributes. Traditionally, attributes are used to set the initial state of an element. Properties with camelCase naming have dash-based attributes. For example: A property "dataSource" will have an attribute called "data-source".

To get a property(option), you need to use the property name along with the jqxNavigationBar's instance.
window.onload = function() {
var propertyValue = document.querySelector("jqx-navigation-bar").animationType;
}

Event binding can be defined in the HTML as an attribute. The syntax is: 'on-' and the event's name. Event Names with camelCase naming have dash-based attributes. The attribute's value is the event handler's name. The addEventListener function can also be used for event binding.

<script>
window.onload = function () {
var element = document.querySelector("jqx-navigation-bar");
element.addEventListener("collapsingItem", function(event){
// Your code here
});
}
</script>

Example

<!DOCTYPE html>
<html lang="en">
<head>
<title id='Description'>NavigationBar Custom Element</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1 maximum-scale=1 minimum-scale=1" />
<link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
<link rel="stylesheet" href="../../jqwidgets/styles/jqx.light.css" type="text/css" />
<link rel="stylesheet" href="../../styles/demos.css" type="text/css" />
<script type="text/javascript" src="../../scripts/webcomponents-lite.min.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxcore.elements.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxnavigationbar.js"></script>
<script>
JQXElements.settings["navigationBarSettings"] =
{
animationType:"fade", theme:"light"
}
</script>
</head>
<body>
<jqx-navigation-bar settings="navigationBarSettings">
<div>
Early History of the Internet
</div>
<div>
<ul>
<li>1961 First packet-switching papers</li>
<li>1966 Merit Network founded</li>
<li>1966 ARPANET planning starts</li>
<li>1969 ARPANET carries its first packets</li>
<li>1970 Mark I network at NPL (UK)</li>
<li>1970 Network Information Center (NIC)</li>
<li>1971 Merit Network's packet-switched network operational</li>
<li>1971 Tymnet packet-switched network</li>
<li>1972 Internet Assigned Numbers Authority (IANA) established</li>
<li>1973 CYCLADES network demonstrated</li>
<li>1974 Telenet packet-switched network</li>
<li>1976 X.25 protocol approved</li>
<li>1979 Internet Activities Board (IAB)</li>
<li>1980 USENET news using UUCP</li>
<li>1980 Ethernet standard introduced</li>
<li>1981 BITNET established</li>
</ul>
</div>
<div>
Merging the networks and creating the Internet
</div>
<div>
<ul>
<li>1981 Computer Science Network (CSNET)</li>
<li>1982 TCP/IP protocol suite formalized</li>
<li>1982 Simple Mail Transfer Protocol (SMTP)</li>
<li>1983 Domain Name System (DNS)</li>
<li>1983 MILNET split off from ARPANET</li>
<li>1986 NSFNET with 56 kbit/s links</li>
<li>1986 Internet Engineering Task Force (IETF)</li>
<li>1987 UUNET founded</li>
<li>1988 NSFNET upgraded to 1.5 Mbit/s (T1)</li>
<li>1988 OSI Reference Model released</li>
<li>1988 Morris worm</li>
<li>1989 Border Gateway Protocol (BGP)</li>
<li>1989 PSINet founded, allows commercial traffic</li>
<li>1989 Federal Internet Exchanges (FIXes)</li>
<li>1990 GOSIP (without TCP/IP)</li>
<li>1990 ARPANET decommissioned</li>
</ul>
</div>
<div>
Popular Internet services
</div>
<div>
<ul>
<li>1990 IMDb Internet movie database</li>
<li>1995 Amazon.com online retailer</li>
<li>1995 eBay online auction and shopping</li>
<li>1995 Craigslist classified advertisements</li>
<li>1996 Hotmail free web-based e-mail</li>
<li>1997 Babel Fish automatic translation</li>
<li>1998 Google Search</li>
<li>1999 Napster peer-to-peer file sharing</li>
<li>2001 Wikipedia, the free encyclopedia</li>
<li>2003 LinkedIn business networking</li>
<li>2003 Myspace social networking site</li>
<li>2003 Skype Internet voice calls</li>
<li>2003 iTunes Store</li>
<li>2004 Facebook social networking site</li>
<li>2004 Podcast media file series</li>
<li>2004 Flickr image hosting</li>
<li>2005 YouTube video sharing</li>
<li>2005 Google Earth virtual globe</li>
</ul>
</div>
</jqx-navigation-bar>
</body>
</html>

The result of the above code is: