Table (Grid): Configuration of the Table and Its Columns
In this topic, you can learn how to configure a table and its columns.
Table Configuration
To specify the configuration parameters of a grid, you use the gridConfig decorator in TypeScript. You put the decorator on the definition of the view class for the table, as shown in the following example.
@gridConfig({
preset: GridPreset.Inquiry,
initNewRow: true,
quickFilterFields: ['AccountClassID', 'Type', 'PostOption', 'CuryID']
})
export class AccountRecords extends PXView {
}
For each table, you must specify a preset in the preset property of the gridConfig decorator. A preset is a predefined set of properties of the gridConfig decorator that define how the table is displayed. For more information about presets, see Form Layout: Grid Presets.
Table Columns
To specify the configuration parameters of a table column, you use the columnConfig decorator, as shown in the following example.
export class SOLine extends PXView {
@columnConfig({ allowShowHide: GridColumnShowHideMode.Server })
ExcludedFromExport: PXFieldState;
IsConfigurable: PXFieldState;
@columnConfig({ hideViewLink: true })
BranchID: PXFieldState<PXFieldOptions.CommitChanges>;
}