A validating, serializable, range-bound date text box with a drop-down calendar.
The functionality of ``aps/DateTextBox`` completely matches the functionality of ``dijit/form/DateTextBox``.
Table of contents
All user panels - CP and UX1
The aps/DateTextBox
is a validating, serializable, range-bound date text box with a drop-down calendar.
The functionality of aps/DateTextBox
completely matches the
functionality of the dijit/form/DateTextBox .
Find the nested rules for this widget in the recommended Widget Hierarchy.
require(["aps/load", "aps/ready!"],
function(load){
"use strict";
load(["aps/PageContainer", [
["aps/Panel", { title: "Test calendar" }, [
["aps/DateTextBox", {
value: "2011-04-12",
label: "birthday"
}]
]]]]);
});
PROPERTY | TYPE | DEFAULT | DESCRIPTION |
---|---|---|---|
autoSize | boolean | true | Only for PCP / CCP v1. |
autoWidth | boolean | true for PCP / CCP v1 and false for CCP v2 | Automatically sets width. |
description | string | “” | Textual description to be displayed as a small greyed text under the control. |
disabled | boolean | false | Specifies if the widget will respond to user input. |
dropDownPosition | array | ['below','above'] for PCP / CCP v1, ['below-centered'] for СCP v2 | An array of strings that shows the allowed positions for the calendar dropdown box. |
gridSize | string | undefined | This specifies the widget width that is relevant only for widgets inside Container, FieldSet, or Tiles. |
hint | string | “” | Help information in a widget. |
isBusy | boolean | false | If the widget is busy then this property is true. |
label | string | “” | Text that is shown as a label if the widget is placed inside a aps/FieldSet. |
optionalText | string | (Optional) | Text for optional widgets of the Input category. |
required | boolean | false | User is required to enter data in the input field. |
size | number | 10 - PCP / CCP v1, undefined - CCP v2 | Affects the selection of a CSS class that defines the width of the input field of the widget. |
visible | boolean | true | If this property value is set to true, then the widget is visible. |
Only for PCP / CCP v1. If this property value is set to “true”, then a CSS class is assigned to the widget based on the value of the “size” property: size <= 7 - f-small-size (40px) 7 < size <= 33 - f-middle-size (215px) 33 < size - f-big-size (240px) The default value of this property is true. If you want to use your own CSS class for defining the widget’s size, you should set this property value to “false” and specify your class name in the widget’s “class” property. Default value: true
Automatically sets width. Default value: true for PCP / CCP v1 and false for CCP v2.
Textual description to be displayed as a small greyed text under the control. Default value: “”.
An array of strings that shows the allowed positions for the calendar dropdown box. Possible values: ‘below’, ‘above’,’below-centered’, ‘above-centered’ Default value: [‘below’,’above’] for PCP / CCP v1, [‘below-centered’] for СCP v2.
This specifies the widget width that is relevant only for widgets inside Container, FieldSet, or Tiles. In other cases it will be ignored.
gridSize string contains few options with number values (from 1 to 12) separated by spaces, which specify the grid size of the widget in different layouts:
- md - desktop
- xs - phone
For example, gridSize: “md-4 xs-2”.
All values below 1, e.g. “md-0”, will be replaced with the empty string (“”), values above 12, e.g. “md-14”, will be reduced to 12 (“md-12”).
Default value: undefined.
Help information in a widget. It is shown under the content of the widget. Deprecated in CCP v2. Default value: “”.
Text that is shown as a label if the widget is placed inside a aps/FieldSet.
Default value: “”.
Text for optional widgets of the Input category. Default value: “(Optional)”.
User is required to enter data in the input field. Default value: false.
Affects the selection of a CSS class that defines the width of the input field of the widget. See the specification for more details.
size <= 7 f-small-size (40px)
7 < size <= 33 f-middle-size (215px)
size > 33 f-big-size (240px)
Default value: 10 - PCP / CCP v1, undefined - CCP v2.
If this property value is set to true, then the widget is visible.
Default value: true.
METHOD | RETURN | DESCRIPTION |
---|---|---|
cancel () | object
|
Sets the isBusy property to false |
destroy () | undefined
|
Destroys this widget |
get () | any
|
Get a property of the Stateful instance |
getParents () | array
|
Discover and return all parents of the widget |
placeAt () | dijit/_widgetbase
function
|
Place this widget somewhere in the DOM based on standard dojo/dom-construct::place() conventions |
set () | object
function
|
Set a property of the Stateful instance |
startup () | undefined
|
Gets started after the DOM fragment is added to the document |
Destroys this widget. Will also destroy any resources (including widgets) registered via this.own(). This method will also destroy internal widgets such as those created from a template.
Return: undefined
Get a property of the Stateful instance. Get a named property of the Stateful object. The property may potentially be retrieved via a getter method in subclasses.
In the base class, this just retrieves the object’s property.
Return: any
Place this widget somewhere in the DOM based on standard dojo/dom-construct::place() conventions. A convenience function providing a simple shorthand mechanism to put an existing (or newly created) widget somewhere in the DOM, and allow chaining.
Return: dijit/_widgetbase function
Set a property of the Stateful instance. Sets named properties of the stateful object and notifies the watchers of the property. A programmatic setter may be defined in subclasses.
Return: object function
Gets started after the DOM fragment is added to the document Called after the widget and its children have been created and added to the page, and all related widgets have finished their create() cycle, up through postCreate().
Note that startup() may be called while the widget is still hidden, for example if the widget is inside a hidden dijit/Dialog or an unselected tab of a dijit/layout/TabContainer. For widgets that need to do layout, it’s best to put that layout code inside resize(), and then extend dijit/layout/_LayoutWidget so that resize() is called when the widget is visible.
Return: undefined
EVENT | RETURN | DESCRIPTION |
---|---|---|
onClick () | undefined
|
The method is called when a user clicks on the widget |
The method is called when a user clicks on the widget.