Documentation

Getting Started

jqxToolBar is a jQuery widget which represents a toolbar where different tools (including widgets) can be automatically added. By default, jqxToolBar supports the widgets jqxButton, jqxToggleButton, jqxDropDownList, jqxComboBox and jqxInput but custom tools can also be added.
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 jqxToolBar widget requires the following files:

<head>
<link type="text/css" rel="Stylesheet" href="../../jqwidgets/styles/jqx.base.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/jqxbuttons.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxlistbox.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxdropdownlist.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxcombobox.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxinput.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxtoolbar.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.
<div id="jqxToolBar">
</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 () {
$("#jqxToolBar").jqxToolBar({ width: "100%", height: 35, tools: "button | dropdownlist combobox | input",
initTools: function (type, index, tool, menuToolIninitialization) {
switch (index) {
case 0:
tool.text("Button");
break;
case 1:
tool.jqxDropDownList({ width: 130, source: ["Affogato", "Breve", "Café Crema"], selectedIndex: 1 });
break;
case 2:
tool.jqxComboBox({ width: 50, source: [8, 9, 10, 11, 12, 14, 16, 18, 20], selectedIndex: 3 });
break;
case 3:
tool.jqxInput({ width: 200, placeHolder: "Type here..." });
break;
}
}
});
});
</script>

To call a function(method), you need to pass the method name and parameters(if any) in the jqxToolBar’s constructor.
    $("#jqxToolBar").jqxToolBar("destroyTool", 0);
To get the result of a function(method) call, you need to pass the method name in the jqxToolBar’s constructor and parameters(if any).
    var tools = $("#jqxToolBar").jqxToolBar("getTools");
To set a property(option), you need to pass the property name and value(s) in the jqxToolBar's constructor.
    $("#jqxToolBar").jqxToolBar({ disabled: true });
    
To get a property(option), you need to pass the property name to the jqxToolBar's constructor.
    var height = $("#jqxToolBar").jqxToolBar("height");
To bind to an event of a UI widget, you can use basic jQuery syntax. The example code below demonstrates how to bind to the "open" event of jqxToolBar.
    // bind to open event.
$("#jqxToolBar").on("open", function (event) {
alert("Pop-up menu opened.");
});

Basic Sample

<!DOCTYPE html>
<html lang="en">
<head>
<title>jQuery Toolbar Sample</title>
<link type="text/css" rel="Stylesheet" href="../../jqwidgets/styles/jqx.base.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/jqxbuttons.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxlistbox.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxdropdownlist.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxcombobox.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxinput.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxtoolbar.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#jqxToolBar").jqxToolBar({ width: "100%", height: 35, tools: "button | dropdownlist combobox | input",
initTools: function (type, index, tool, menuToolIninitialization) {
switch (index) {
case 0:
tool.text("Button");
break;
case 1:
tool.jqxDropDownList({ width: 130, source: ["Affogato", "Breve", "Café Crema"], selectedIndex: 1 });
break;
case 2:
tool.jqxComboBox({ width: 50, source: [8, 9, 10, 11, 12, 14, 16, 18, 20], selectedIndex: 3 });
break;
case 3:
tool.jqxInput({ width: 200, placeHolder: "Type here..." });
break;
}
}
});
});
</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>
<div id="jqxToolBar">
</div>
</body>
</html>

The result of the above code is: