The Predefined Configuration for the Layout function.
The Layout State contains a collection of Layouts and the Current Layout:
|CurrentLayout||Layout which will be loaded when AdapTable starts - must appear as Name property in a provided Layout||''|
|Layouts||Collection of Layout objects - will appear in the Layout toolbar and Tool Panel||null|
The full contents of the Layout object is as follows:
|AggregationColumns||Which columns will show aggregated values in grouped rows; first value in record is Column name and second is either the agg func (e.g. sum, avg etc.) or 'true' (to use default aggfunc)|
|AutoSave||Whether the Layout should automatically save or not - overrides |
|Columns||Which columns should be visible in the Layout and in which order|
|ColumnSorts||The Sorting which will be applied in the Layout|
|ColumnWidthMap||Set of widths for some (or all columns)|
|EnablePivot||Whether pivoting should be enabled in the Grid when this Layout loads|
|ExpandedRowGroupValues||Values of any row groups that have been opened - only used if |
|Name||Name of Layout as will appear in Layout toolbar and tool panel|
|PinnedColumnsMap||A set of pinned Columns|
|PivotColumns||List of Columns which should be pivoted when grid is in pivot mode|
|RowGroupedColumns||Which columns should be row-grouped when the Layout is applied|
As can be seen, there are a number of useful properties and collections including:
Which columns should be visible in the Layout and in which order.
The names in this list should match those provided when the Columns were defined in the vendor grid (e.g.
field in ag-Grid).
When the Layout is first applied, only the Columns in this array will be visible - and in the order that they are listed here.
ColumnWidthMap is a set of widths for some (or all columns)
The object is defined as follow:
To use its, simply pass the names of the Columns (without quotes) together with the widths required:
ColumnSorts is a collection of ColumnSort objects which define the sorting which will be applied in the Layout.
The object has 2 properties:
- Column name
- Sort Order (e.g. 'Asc' or 'Desc')
Row Grouped Columns
List of columns which should be row-grouped when the Layout is applied.
Make sure that the column names supplied are groupable according to the vendor grid you are using (e.g.
enableRowGroup in ag-Grid)
Expanded Row Group Values
ExpandedRowGroupValues is a collection of values detailing which Row Groups are opened.
This is only used if
includeExpandedRowGroups in LayoutOptions is set to true
This is typically set by AdapTable at run-time, rather than provided in Predefined Config
This only applies when row grouping is enabled in the grid.
The definition is a
Record which contains 2 values:
The Column name
Either the agg func required (e.g. sum, avg, min etc.) or *true(to use the default aggfunc)
The true value can only be used if an aggFunc was previously defined for the Column
PivotColumns is a collection of names of Columns which should be pivoted when Grid is in Pivot Mode.
This will only be applied if the
enablePivot property is set to true
Defines a set of pinned columns. The definition of the
PinnedColumnsMap object is:
To use provide the name of the Column (without quotes) together with the direction (of 'left' or 'right')