Replace the IG Single Row View with a Row View in a regular region, dialog or drawer.
See this blog item for an overview of the functionality.
The region plugin is a wrapper around the recordView widget which gets instantiated with the same model and field configuration as the related IG.
To be able to configure an external row view (ERV) for an IG, you need to disable the IG Single Row View (SRV) feature. In IG init function:
function(options) {
let features = apex.util.getNestedObject(options, 'views.grid.features');
features.singleRowView = false;
return options;
}
Configuring an ERV region:
For an explanation of the declarative settings, see the inline help.Next options can be set programmatically: 'alwaysEdit', 'applyTemplateOptions', 'formCssClasses', 'labelAlignment', 'showNullAs', 'skipDeletedRecords', 'suppressValCloseQuestion'
See the recordView options for an explanation on all except the last option.
The 'suppressValCloseQuestion' option can be used to suppress a default behavior when a dialog or drawer is closed while the row still has validation errors. By default it will ask a question if to proceed.
function(config)
{
config.alwaysEdit = true;
config.suppressValCloseQuestion = true;
return config;
}
Individual fields can be further programmatically configured as per the field properties. For this, you can utilize the IG column JavaScript init func. For example when you want to configure your own layout using field column spans:
function(options) {
options.defaultGridColumnOptions = {
fieldColSpan: 2
};
return options;
}
Next classes can be used to reduce a field item width. Configure the class on the IG column, Advanced CSS classes.
- lib4x-form-field-width-25p
- lib4x-form-field-width-50p
- lib4x-form-field-width-75p
The 'lib4x-ig-erv-hidden' class can be used to hide a field. Have the class on the IG column, Appearance CSS classes.
This class can also be used on 'Link Attributes' in case you have a link column in the IG grid, but you don't want to show the link in the ERV.
In case you want to include a link column in the IG grid as to open the ERV (dialog or drawer) from there, you can use the 'lib4x-erv-open' action. Link config:
#action$lib4x-erv-open
<span class="fa fa-edit"/>
lib4x-ig-erv-hidden
Next messages are available for translation:
- 'LIB4X.ERV.COL_EXP_GRP': 'Collapse/Expand Groups',
- 'LIB4X.ERV.COL_GRP': 'Collapse Groups',
- 'LIB4X.ERV.EXP_GRP': 'Expand Groups',
- 'LIB4X.ERV.Q_VAL_ERR_CLOSE_DIALOG': 'Data has validation errors. Close Dialog?'
The recordView widget can be reached via:
apex.region('<ERV Static Id>').widget().recordView('<method>')