Documentation

Getting Started

jqxExpander represents a jQuery widget that has header and content sections(like tabs). Click headers to expand or collapse the content. Optionally you can change the default toggle mode to double-click or mouseover.
Every UI widget 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 jqxExpander widget requires the following files:

<head>
<link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
<script type="text/javascript" src="../../scripts/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxexpander.js"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-2FX5PV9DNT"></script><script>window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'G-2FX5PV9DNT');</script></head>

The next step is to create a DIV element within the body of the html document and add a pair of DIV elements for the header and content.
<div id='jqxexpander'>
<!--Header-->
<div>
Header</div>
<!--Content-->
<div>
Content
</div>
</div>

The last step is to initialize the widget by adding the following script to the html document:
<script type="text/javascript">
$(document).ready(function () {
// Create jqxExpander
$("#jqxexpander").jqxExpander({ width: 400, height: 200 });
});
</script>

To call a function(method), you need to pass the method name and parameters(if any) in the jqxExpander’s constructor.
$("#jqxExpander").jqxExpander(‘expand’);
To get the result of a function(method) call, you need to pass the method name in the jqxExpander’s constructor and parameters(if any).
var content = $("#jqxExpander").jqxExpander(‘getContent’);
To set a property(option), you need to pass the property name and value(s) in the jqxExpander's constructor.
$("#jqxExpander").jqxExpander({ disabled: true });
To get a property(option), you need to pass the property name to the jqxExpander's constructor.
var disabled = $("#jqxExpander").jqxExpander('disabled');
To bind to an event of a UI widget, you can use basic jQuery syntax. Let’s suppose that you want to get the selected item when the user clicks. The example code below demonstrates how to bind to the ‘collapsed’ event of jqxExpander.
// bind to collapsed event.
$("#jqxexpander").on('collapsed', function (event) {
alert("Collapsed");
});

Basic Sample

<!DOCTYPE html>
<html lang="en">
<head>
<title>jQuery Expander Sample</title>
<link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
<script type="text/javascript" src="../../scripts/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxexpander.js"></script>
<script type="text/javascript">
$(document).ready(function () {
// Create jqxExpander
$("#jqxexpander").jqxExpander({ width: 200, height: 100 });
// bind to expanded event.
$("#jqxexpander").bind('expanded', function (event) {
alert("Expanded");
});
// bind to collapsed event.
$("#jqxexpander").bind('collapsed', function (event) {
alert("Collapsed");
});
});
</script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-2FX5PV9DNT"></script><script>window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'G-2FX5PV9DNT');</script></head>
<body class='default'>
<div id='jqxexpander'>
<!--Header-->
<div>
Header</div>
<!--Content-->
<div>
Content
</div>
</div>
</body>
</html>

The result of the above code is: