Date and Time Control: Conversion from ASPX to HTML and TypeScript
The following tables will help you to convert ASPX elements that are related to date and time controls to HTML or TypeScript elements.
PXDateTimeEdit
The following table shows the correspondence between the PXDateTimeEdit ASPX control and HTML or TypeScript elements. During the conversion of ASPX pages to HTML and TypeScript, you need to replace these ASPX elements with their analogs in HTML or TypeScript.
ASPX | HTML or TypeScript |
---|---|
PXDateTimeEdit
|
To display two separate boxes for date and time, in the TypeScript code of the form, define two fields—a field for the date and a field for the time—as shown in the following code.
In HTML code of the form, use the
field tag for the date field
and a nested qp-field tag for the time field, as the following
code shows.
|
CommitChanges
|
Use the CommitChanges option of
PXFieldState in TypeScript, as the following code shows. With
this option, the control commits changes to the server each time a user has changed
the value in the box and focus is no longer on the
box.
|
DataField
|
To specify the data fields to be used for the date and time control, use the
name attribute of the field tag for the date
field, and control-state.bind of the qp-field
tag for the time field, as the following code
shows.
|
ID
|
Use the id attribute of the nested qp-field
tag for the time field, as the following code shows. The id
attribute is not used for field
tags.
|
SuppressLabel
|
To hide the label for a field, use class="no-label" for the
field, as the following code shows. For details about the class, see Form Layout: CSS Classes.
|
TimeMode
|
To indicate that the field contains time, use the timeMode
property of config of the field, as shown in the following
code.
|
Width
|
Use the col-N class to define the width of the field, as the
following code shows. In col-N, N is the number of columns
the field occupies, which can be a whole number between 1 and 12. For details about
the class, see Form Layout: CSS Classes.
|
Obsolete ASPX Controls and Properties
The following table lists obsolete ASPX elements that are related to date and time controls. You do not need to replace these ASPX elements with any HTML or TypeScript elements.
ASPX Control | Property |
---|---|
PXDateTimeEdit | runat |