Skip to main content
Version: 8.1

BaseGridDetailV2 schema

Level: advanced

BaseGridDetailV2 is a base schema of a list detail. Provides the base logic for list management (loading, filtering), as well as deleting, adding, and editing detail records. Implemented in the NUI package. This is a view model schema. Learn more about the schema properties in a separate article: Client schema. Inherits the BaseDetailV2 schema. Schemas of list details must inherit the BaseGridDetailV2 schema.

Messages

Messages of a base list detail

Name

Mode

Direction

Description

getCardInfo

Address

Subscription

Returns the record page data: default values, typing column name, typing column value.

CardSaved

Broadcasting

Subscription

Processes the saving message of the record page.

RerenderQuickFilterModule

Address

Publishing

Publishes the message that has the filter applied.

GetExtendedFilterConfig

Address

Subscription

Publishes the configuration of a custom filter.

GetModuleSchema

Address

Subscription

Returns data about the entity that manages the filter.

UpdateFilter

Broadcasting

Subscription

Updated the filters in the detail.

LoadedFiltersFromStorage

Broadcasting

Publishing

The filters loaded from the repository.

InitFilterFromStorage

Broadcasting

Subscription

Initializes the filters loaded from the repository.

GetColumnsValues

Address

Publishing

Retrieves the column values of the record page model.

IsCardChanged

Address

Publishing

Notifies of record page changes.

ValidateCard

Address

Publishing

Requests to validate the record page.

The Terrasoft.core.enums.MessageMode enumeration represents the message modes, and the Terrasoft.core.enums.MessageDirectionType enumeration represents the message directions. Learn more about the MessageMode enumeration in the JS class library. Learn more about the MessageDirectionType enumeration in the JS class library.

Mixins

GridUtilities Terrasoft.GridUtilities

Mixin for list management.

WizardUtilities Terrasoft.WizardUtilities

Mixing for Detail Wizard management.

Attributes

ActiveRow GUID

The primary column value of the active list record.

IsGridEmpty BOOLEAN

The flag that marks the list as empty.

MultiSelect BOOLEAN

The flag that enables multiple selection.

SelectedRows COLLECTION

The array of selected records.

RowCount INTEGER

The number of rows in the list.

IsPageable BOOLEAN

The flag that enables list pagination.

SortColumnIndex INTEGER

Index of the sorting column.

CardState TEXT

Record page opening mode.

EditPageUId GUID

Unique ID of the record page.

DetailFilters COLLECTION

Collection of detail filters.

IsDetailWizardAvailable BOOLEAN

The flag that marks the Detail Wizard as available.

The Terrasoft.core.enums.DataValueType enumeration represents the attribute data types. Learn more about the DataValueType enumeration in the JS class library.

Methods

init(callback, scope)

Replaces the BaseDetailV2 class method. Calls the logic of the parent schema’s init method, registers messages, initializes filters.

Parameters

callback

The callback function.

scope

The method execution context.

initData(callback, scope)

Replaces the BaseDetailV2 class method. Calls the logic of the parent’s initData method, initializes the data collection of the list view model.

Parameters

callback

The callback function.

scope

The method execution context.

loadGridData()

Loads the list data.

initGridData()

Initializes the default values for list management.

getGridData()

Returns the list collection.

getFilters()

Returns the detail filters collection.

getActiveRow()

Returns the ID of the selected list record.

addRecord(editPageUId)

Adds a new record to the list. Saves the record page if needed.

Parameters

{String} editPageUId

The ID of the typed record page.

copyRecord(editPageUId)

Copies the record and opens the record page.

Parameters

{String} editPageUId

The ID of the typed record page.

editRecord(record)

Opens the page of the selected record.

Parameters

record

The model of the page to edit.

subscribeSandboxEvents()

Subscribes to messages required for detail to operate as intended.

updateDetail(config)

Replaces the BaseDetailV2 class method. Calls the logic of the parent schema’s updateDetail method, updates the detail.

Parameters

config

Configuration object that contains the detail properties.

openCard(operation, typeColumnValue, recordId)

Opens the record page.

Parameters

{String} operation

Operation type (add/edit).

{String} typeColumnValue

The value of the record typing column.

{String} recordId

Record ID.

onCardSaved()

Processes the detail record page’s save event.

addToolsButtonMenuItems(toolsButtonMenu)

Adds elements to the collection of the functional button’s drop-down list.

Parameters

{Terrasoft.BaseViewModelCollection} toolsButtonMenu

The collection of the functional button’s drop-down list

initDetailFilterCollection()

Initializes the detail filter.

setFilter(key, value)

Sets the value of detail filters.

Parameters

{String} key

Type of the filters.

value

Value of the filters.

loadQuickFilter(config)

Loads the quick filter.

Parameters

config

The load parameters of the filter module.

destroy()

Clears data, unloads the detail.

Array of modifications

In base list detail, the diff array of modifications defines only the base container for the detail view.

diff array of modifications
diff: /**SCHEMA_DIFF*/ [
{
/* The element that displays the list. */
"operation": "insert",
"name": "DataGrid",
"parentName": "Detail",
"propertyName": "items",
"values": {
"itemType": Terrasoft.ViewItemType.GRID,

}
},
{
/* The button that loads more list data. */
"operation": "insert",
"parentName": "Detail",
"propertyName": "items",
"name": "loadMore",
"values": {
"itemType": Terrasoft.ViewItemType.BUTTON,

}
},
{
/* The button that adds records. */
"operation": "insert",
"name": "AddRecordButton",
"parentName": "Detail",
"propertyName": "tools",
"values": {
"itemType": Terrasoft.ViewItemType.BUTTON,

}
},
{
/* The button that adds a typed record. */
"operation": "insert",
"name": "AddTypedRecordButton",
"parentName": "Detail",
"propertyName": "tools",
"values": {
"itemType": Terrasoft.ViewItemType.BUTTON,

}
},
{
/* The detail menu. */
"operation": "insert",
"name": "ToolsButton",
"parentName": "Detail",
"propertyName": "tools",
"values": {
"itemType": Terrasoft.ViewItemType.BUTTON,

}
}
] /**SCHEMA_DIFF*/