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 jqxDateTimeInput.
  • jqx-input - applied to jqxDateTimeInput widget.
  • jqx-input-content - applied to the input's content.
  • jqx-widget-content - applied to the input's content.
  • jqx-input-disabled - applied to the input when it is disabled.
  • jqx-input-button-header - applied to the jqxDateTimeInput's button header.
  • jqx-widget-header - applied to the jqxDateTimeInput's button header.
  • jqx-input-button-innerHeader - applied to the element which is in the middle of the jqxDateTimeInput's button header.
  • jqx-input-button-content- applied to the jqxDateTimeInput's button content.
  • jqx-fill-state-focus - applied to the jqxDateTimeInput when it is focused.
  • jqx-fill-state-disabled - applied to the jqxDateTimeInput when it is disabled.
*jqxDateTimeInput internally use the jqxCalendar widget. For additional information about styling jqxCalendar, please take a look at the jqxCalendar's Styling and Appearance help topic.

When you create a custom style with colors and backgrounds for jqxDateTimeInput, you need to do the following:
  • Add the above CSS classes related to jqxDateTimeInput
  • After each CSS class, add your theme name.
    For example:
    jqx-input-themename
  • To apply your custom style to jqxDateTimeInput, you need to set its 'theme' property(option) to point to your theme name string.
    <script type="text/javascript">
    $(document).ready(function () {
    $("#jqxdatetimeinput").jqxDateTimeInput({ width: '250px', height: '25px', theme: 'summer' });
    });
    </script>
  • The sample below demonstrates how to set the 'Summer' theme to jqxDateTimeInput.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html lang="en">
    <head>
    <meta name="keywords" content="jQuery DataTimeInput, DataTimeInput, jqxDateTimeInput, DateTimePicker, jQuery Widgets, jQuery UI, jQuery Plugins" />
    <title>jQuery DateTimeInput CSS Styling and Appearance Sample</title>
    <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css"/>
    <link rel="stylesheet" href="../../jqwidgets/styles/jqx.summer.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/jqxdatetimeinput.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxcalendar.js"></script>
    <script type="text/javascript"
    src="../../jqwidgets/globalization/globalize.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>
    <body>
    <div id='content'>
    <script type="text/javascript">
    $(document).ready(function () {
    $("#jqxdatetimeinput").jqxDateTimeInput({ width: '250px', height: '25px', theme: 'summer' });
    });
    </script>
    <div id='jqxdatetimeinput'></div>
    </div>
    </body>
    </html>