Table (Grid): Conversion from ASPX to HTML and TypeScript
The following tables will help you to convert ASPX elements that are related to tables to HTML or TypeScript elements.
ActionBar
The following table shows the correspondence between the ActionBar ASPX element and the 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 |
---|---|
ActionBar
|
To specify the toolbar buttons for the grid, define actions in the view class
of the grid in TypeScript, as shown in the following
code. You can also specify particular action properties with the
actionsConfig and defaultAction properties
in the gridConfig decorator. |
DefaultAction
|
Use the defaultAction property of the
gridConfig decorator, as shown in the following code. The
property specifies the action that is executed when a user double-clicks a record in
the table.
|
AutoCallback
The following table shows the correspondence between the AutoCallback ASPX element and the 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 |
---|---|
AutoCallback
|
Use the autoRepaint property in the
gridConfig decorator, as shown in the following code. The
property refreshes the specified data view depending on the record selected in the
table.
|
CallbackCommands
The following table shows the correspondence between the CallbackCommands ASPX element and the 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 |
---|---|
CallbackCommands
|
Use the pasteCommand property in the
gridConfig decorator, as shown in the following code. The
property specifies the name of the command that performs the paste
operation.
|
Mode
The following table shows the correspondence between the Mode ASPX element and the 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 |
---|---|
AllowAddNew
|
Use the allowInsert property of the
gridConfig decorator. If the value is true, this
property indicates that a user can insert new records directly in the table. The
following code uses this property.
|
AllowDelete
|
Use the allowDelete property of the
gridConfig decorator. If the value is true, this
property indicates that a user can delete records directly in the table. The
following code uses this property.
|
AllowDragRows
|
Use the allowDragRows property of the
gridConfig decorator. If the value is true, this
property indicates that a user can drag rows in the table. The following code uses
this property.
|
AllowRowSelect
|
Use the allowRowSelect property of the
gridConfig decorator. If the value is true, this
property indicates that a user can select a row in the table. The following example
uses this property.
|
AllowUpdate
|
Use the allowUpdate property of the
gridConfig decorator. If the value is true, this
property indicates that a user can update records in the table. The following code
uses this property.
|
InitNewRow
|
Use the initNewRow property of the
gridConfig decorator. If the value is true, this
property indicates that the webpage should perform a server callback upon the
insertion of a new row. Normally, when a user clicks the Add
Row button on a table toolbar, the new empty row is created only on
the webpage, and the data is not sent to the application server. This means that
the C# code with all event handlers is not executed. For the data to be sent to
the server, you need to specify The following
code uses this property.
|
PXGrid
The following table shows the correspondence between the PXGrid ASPX control and the 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 |
---|---|
PXGrid
|
Is replaced by qp-grid in HTML. To define a table, you need
to instantiate a view class with the gridConfig decorator in
TypeScript and add a qp-grid tag in HTML, as shown in the
following code fragments.
|
AdjustPageSize
|
Use the adjustPageSize property in the
gridConfig decorator, as shown in the following example. If the
value is true, this property makes the table show only one page of rows,
without the vertical scrollbar. The following code uses this
property.
|
AllowFilter
|
Use the allowStoredFilters in the
gridConfig decorator, as shown in the following code. If the
value is true, the system adds the Search box for the table. The following
code uses this property.
|
AllowPaging
|
Use the pagerMode property in the
gridConfig decorator, as shown in the following code. The
property defines whether pages should be displayed for the table. The property can
have one of the following values, which are defined by the
GridPagerMode enum:
|
AutoAdjustColumns
|
Use the autoAdjustColumns property in the
gridConfig decorator. If the value is true, the property
makes the system adjust the column width automatically. The following code uses this
property.
|
AutoGenerateColumns
|
Use the generateColumns property of the gridConfig decorator. The property defines the mode of column generation for the table. You can use one of the following modes, which are defined in the GridColumnGeneration enum:
|
AutoSaveLayout
|
Use the autoSaveLayout property of the
gridConfig decorator. If the value is true, the property
makes the system save the layout of the table after each column is resized. The
following code uses this property.
|
BatchUpdate
|
Use the batchUpdate property of the
gridConfig decorator, as shown in the following code. If a
table contains editable fields that depend on each other, the
BatchUpdate property should be
false.
|
Caption
|
Use the caption attribute of the qp-grid
control in HTML. The attribute defines a title for the table. When the table is
hidden, the title specified in the caption attribute is hidden
too.Note: The following
code specifies a title for the table.Do not use the qp-caption or
qp-label tags to specify a table title.
|
EditPageUrl
|
Use the gridDataUrl property in the gridConfig decorator. You can use this property to change the standard API for the retrieval of the table data. |
FastFilterFields
|
Use allowFastFilter in the columnConfig decorator for the needed columns or fastFilterByAllFields in the gridConfig decorator. Take into account the following considerations:
|
FastFilterId
|
Use the qp-fast-filter attribute of the field tag, as described in Table (Grid): Configuration of the Search in the Table. |
FilesIndicator
|
Use the showNoteFiles property in the
gridConfig decorator. The following code uses this
property.
|
ID
|
Use the id attribute of the qp-grid
control in HTML. The attribute specifies the ID of the control, as shown in the
following code.
|
KeepPosition
|
Use the keepPosition property in the
gridConfig decorator. This property indicates whether the
system keeps the keys of the record selected in the grid. The following code uses
this property.
|
MarkRequired
|
Use the markRequired property in the
gridConfig decorator. This property indicates whether the
columns of the table can be marked as required. The following code uses this
property.
|
NoteIndicator
|
Use the showNoteFiles property in the
gridConfig decorator. The following code uses this
property.
|
PageSize
|
Use the pageSize property in the
gridConfig decorator. This property specifies the maximum
number of records on a page if the table is displayed on multiple pages. The
following code uses this property.
|
PreserveSortsAndFilters
|
Use the preserveSortsAndFilters property in the
gridConfig decorator. If the value is true, this
property specifies that the current filter and sorted columns should be stored in
the session. By default, the value is false. The following code uses this property.
|
SkinID
|
Use the preset property of the gridConfig
decorator. The property specifies a set of settings that define the appearance of
the table. The following values, which are defined by the
GridPreset enum, are available:
For more information about presets, see Form Layout: Grid Presets. The following code uses
this property.
|
StatusField
|
Use the statusField property of the
gridConfig decorator. The property specifies the name of the
column that is displayed in the footer of the table. The following code uses this
property.
|
SyncPosition
|
Use the syncPosition property of the gridConfig decorator. If the value is true, the property specifies that the Current record must be synchronized with the record selected in the table. Tip: The following code uses this property.If a form contains a table and the form toolbar includes an action to process a single record that is selected in the table, the action delegate method must have a reference to the selected record in the cache. To use the Current property of a PXCache object to access the record selected in a table, the Current property must be synchronized with the record selected in the grid. To force the system to provide this synchronization, you have to set the syncPosition property of the gridConfig decorator to true.
|
TabIndex
|
Use the tabIndex property of the
gridConfig decorator. The property specifies the index of the
table during the TAB navigation. The following code uses this
property.
|
ASPX | HTML or TypeScript |
---|---|
PXGridColumn
|
Define columns in the view class of the table in TypeScript, as shown in the
following example.
|
AllowCheckAll
|
Use the allowCheckAll property in the
columnConfig decorator, as shown in the code below. If the
value is true, the system adds a check box in the header of the column, which
gives the user the ability to select all check boxes in the column for the
page.
|
AllowFilter
|
Use the allowFilter property in the
columnConfig decorator, as the following code shows. If the
value is true, the system adds column filtering in the header of the
column.
|
AllowFocus
|
Use the allowFocus property in the
columnConfig decorator, as the following code shows. If the
value is true, the system places the cursor in the column when a new record
is added to the table.
|
AllowNull
|
Use the allowNull property in the
gridConfig decorator, as shown below. If the value is
false, the system prevents the cell value from being
cleared.
|
AllowShowHide
|
Use the allowShowHide property in the
columnConfig decorator. The property manages a user's ability
to show or hide the column in the table. (The user can show or hide the column in
the Column Configuration dialog box.) The property can have one of the following values, which are defined by the GridColumnShowHideMode enum:
The following code shows an example of the use of this property.
|
AllowSort
|
Use the AllowSort property of the
columnConfig decorator, as shown in the following code. If the
value is false, the property turns off the capability for a user to sort the
values in the column.
|
AllowUpdate
|
Use the allowUpdate property of the
columnConfig decorator. If the value is true, the
property indicates that a user can update the value in the column. The following
example uses this property.
|
CommitChanges
|
Use PXFieldOptions.CommitChanges in TypeScript, as shown in
the following code. The option indicates that the webpage commits the changes in the
column to the server.
|
DataField
|
Define data field for the column in the view class of the table in TypeScript,
as shown in the following
code.
|
Decimals
|
Use the decimals property of the
columnConfig decorator. The property defines the number of
decimal values to be displayed in the column cells. The following example uses this
property.
|
DisplayFormat
|
Use the format property of the columnConfig decorator. The property specifies
the custom display format for date and numeric columns. For example, you can set
format="g" if you want to see date and time in a date
column.
For the list of possible values, see Standard numeric format strings and Standard date and time format strings in Microsoft documentation. |
DisplayMode
|
Use the displayMode property in the
columnConfig decorator, as shown in the code below. The
property specifies the display mode for each cell of the column. The display mode,
which is defined by the GridColumnDisplayMode enum, can be one of
the following:
|
ForceExport
|
Use the suppressExport property of the
columnConfig decorator. If the value is true, the
property specifies that the column is not included in the results of the export of
the table. The following code uses this property.
|
Key
|
Use the key property of the columnConfig
decorator. The property specifies the key for unbound columns, such as Notes and
Files. The following code uses this property.
|
LinkCommand
|
Use the
linkCommand
decorator for the column field in TypeScript, as shown in the following example. The
decorator specifies the action that is executed when a user clicks the link in the
column cell.
|
MaxLength
|
Use the maxLength property in the
columnConfig decorator. The property specifies the maximum
length of the string in the column. The following code uses this
property.
|
NullText
|
Use the nullText property in the
columnConfig decorator. The property specifies the value that
is displayed if the column value is NULL. The following code uses this
property.
|
RenderEditorText
|
Use the renderEditorText property in the
columnConfig decorator. The property indicates whether the
column value is rendered in the way this value is displayed in inline-edit mode. The
following code uses this property.
|
TextAlign
|
Use the textAlign property in the columnConfig decorator. The property specifies the alignment of the values in the column. You can use one of the following values, which are defined in the TextAlign enum:
|
TextField
|
Use the textField property in the
columnConfig decorator. The property specifies explicitly which
field should be displayed in the column selector control. The following code uses
this property.
|
TimeMode
|
Use the timeMode property in the
columnConfig decorator. If the value is true, the
property turns on the time mode for the date and time column. The following code
uses this property.
|
Type
|
Use the type property in the columnConfig decorator. The property specifies the type of the column content. You can use one of the following values, which are defined by the GridColumnType enum:
The following code uses this property.
|
Visible
|
Use PXFieldOptions.Hidden in TypeScript, as shown in the following code.
In particular cases, you can use the visible property of the columnConfig decorator, as shown in the following code.
Columns with |
Width
|
Use the width property in the
columnConfig decorator. The property specifies the width of the
column. The width is defined in pixels. The following code uses this
property.
|
PXGridColumn
The following table shows the correspondence between the PXGridColumn ASPX element and the 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 |
---|---|
PXGridColumn
|
Define fields for the columns in TypeScript in the view class that corresponds
to the table (grid) and use the columnConfig decorator to specify
column properties, as shown in the following code fragment. Generally, you do not
need to add any tags for columns in HTML.
|
DataField
|
Define fields for the columns in TypeScript in the view class that corresponds
to the table (grid), as shown in the following code fragment.
|
DisplayFormat
|
Use the format property of the
columnConfig decorator, as shown in the following
example.
|
PXGridLevel
The following table shows the correspondence between the PXGridLevel ASPX element and the 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 |
---|---|
DataMember
|
|
ImportDataMember
|
Use the importView property of the gridConfig decorator. |
PXGridWithPreview
The following table shows the correspondence between the PXGridWithPreview ASPX control and the 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 |
---|---|
PXGridWithPreview
|
To define a grid with a preview text editor below, use the qp-splitter tag, as shown in the following example.
|
Obsolete ASPX Controls and Properties
The following table lists the obsolete ASPX elements that are related to tables. You do not need to replace these ASPX elements with any HTML or TypeScript elements.
ASPX Control | Properties |
---|---|
ClientEvents
|
All properties |
OnChangeCommand
|
All properties |
Mode
|
|
PXGrid
|
|