Documentation

Styling and Appearance

jQWidgets uses a pair of css files - jqx.base.css and jqx.[theme name].css. The base stylesheet creates the styles related to the widget's layout like margin, padding, border-width, position. The second css file applies the widget's colors and backgrounds. The jqx.base.css should be included before the second CSS file.

Below is the list of CSS classes used by jqxToolBar.
  • jqx-toolbar - applied to the jqxToolBar widget.
  • jqx-widget - applied to the jqxToolBar widget.
  • jqx-fill-state-normal - applied to the jqxToolBar widget and its minimize pop-up menu.
  • jqx-rc-all - applied to the jqxToolBar widget.
  • jqx-fill-state-disabled - applied to the jqxToolBar widget when it is disabled.
  • jqx-toolbar-tool - applied to tools in the jqxToolBar.
  • jqx-toolbar-tool-minimized - applied to minimized tools in the jqxToolBar.
  • jqx-toolbar-tool-rtl - applied to tools in the jqxToolBar when the property rtl is set to true.
  • jqx-toolbar-minimized-button - applied to the jqxToolBar minimize button.
  • jqx-menu-minimized-button - applied to the jqxToolBar minimize button.
  • jqx-toolbar-minimized-button-rtl - applied to the jqxToolBar minimize button when the property rtl is set to true.
  • jqx-toolbar-minimized-popup - applied to the jqxToolBar minimize pop-up menu.
  • jqx-toolbar-minimized-popup-separator - applied to horizontal separators in the jqxToolBar minimize pop-up menu.
When you create a custom style with colors and backgrounds for jqxToolBar, you need to do the following:
  • Add the above CSS classes related to jqxToolBar
  • After each CSS class, add your theme name.
    For example:
    jqx-toolbar-summer
  • To apply your custom style to jqxToolBar, you need to set its 'theme' property(option) to point to your theme name string.
    <script type="text/javascript">
    $(document).ready(function () {
    $("#jqxToolBar").jqxToolBar({ theme: "summer", 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>
    The theme is automatically applied to all non-custom tools in jqxToolBar.
  • The sample below demonstrates how to set the 'summer' theme to jqxToolBar.
    <!DOCTYPE html>
    <html lang="en">
    <head>
    <title>jQuery Toolbar Styling 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({ theme: "summer", 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>