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 jqxFormattedInput.- jqx-formatted-input - applied to the formatted input.
- jqx-input - applied to the formatted input.
- jqx-widget - applied to the formatted input and its pop-up.
- jqx-widget-content - applied to the formatted input and its pop-up.
- jqx-rc-all - applied to the formatted input (if the spin buttons and pop-up are disabled) or to the pop-up items. Adds rounded corners to the widget.
- jqx-input-disabled - applied to the formatted input when it is disabled.
- jqx-fill-state-disabled - applied to the formatted input when it is disabled.
- jqx-formatted-input-spin-buttons-container - applied to the spin buttons conatiner div.
- jqx-formatted-input-spin-button - applied to the spin buttons.
- jqx-formatted-input-addon - applied to the pop-up menu button div.
- jqx-fill-state-normal - applied to the spin buttons conatiner, spin buttons and pop-up menu button.
- jqx-popup - applied to the formatted input's pop-up.
- jqx-input-popup - applied to the formatted input's pop-up.
- jqx-menu - applied to the formatted input's popup.
- jqx-menu-vertical - applied to the formatted input's pop-up.
- jqx-menu-dropdown - applied to the formatted input's pop-up.
- jqx-menu-item - applied to the formatted input's pop-up items.
- jqx-item - applied to the formatted input's pop-up items.
- jqx-formatted-input-item - applied to the formatted input's pop-up items.
- jqx-fill-state-pressed - applied to the selected item in the formatted input's pop-up.
- Add the above CSS classes related to jqxFormattedInput
- After each CSS class, add your theme name.
For example:
jqx-formatted-input-summer - To apply your custom style to jqxFormattedInput, you need to set its 'theme' property
(option) to point to your theme name string:
<script type="text/javascript"> $(document).ready(function () { $("#jqxFormattedInput").jqxFormattedInput({ theme: "summer", width: 250, height: 25, radix: "binary", value: "1111011", spinButtons: true, dropDown: true }); });</script>
- The sample below demonstrates how to set the 'summer' theme to jqxFormattedInput:
<!DOCTYPE html><html><head> <title>jQuery Formatted Input 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/jqxformattedinput.js"></script> <script type="text/javascript"> $(document).ready(function () { $("#jqxFormattedInput").jqxFormattedInput({ theme: "summer", width: 250, height: 25, radix: "binary", value: "1111011", spinButtons: true, dropDown: true }); }); </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="jqxFormattedInput"> <input type="text" /> <div> </div> <div> </div> </div></body></html>