| Parameter | Description |
|---|---|
| aGroups | Array of groups and subgroups to apply |
| bOptOverrideDefault | Indicates if a layout loaded from local storage should be overwritten (see pbStoreGroupConfig) (default: True) |
Procedure ApplyGroupConfig tWebGroupConfig[] aGroups Boolean bOptOverrideDefault
| Call: | Send ApplyGroupConfig aGroups bOptOverrideDefault |
Applies a group configuration for automatic grouping.
Call this procedure to apply a group configuration for automatic grouping.
The group configuration is provided in the form of an array of tWebGroupConfig structs defining on which columns should be grouped.
- The first item is the first level of grouping, where the second item defines the first sublevel.
- The iColumn member of tWebGroupConfig should match the piColumnId of the cWebColumn that should be grouped by.
- The sLabel determines the label shown in the group headers (and the group selector) and bReverse determines the sort direction.
This example calls ApplyGroupConfig during OnLoad to initialize the grouping on the State and City columns.
Object oCustomerWebList is a cWebList
Set Server to oCustomer_DD
Set peDbGridType to gtAllData
Set peGrouping to grpAutomatic
Set pbFillHeight to True
Object oCustomer_State is a cWebColumn
Entry_Item Customer.State
Set psCaption to "State"
Set piWidth to 50
Set pbHidden to True
End_Object
Object oCustomer_Customer_Number is a cWebColumn
Entry_Item Customer.Customer_Number
Set psCaption to "Number"
Set piWidth to 95
End_Object
Object oCustomer_Name is a cWebColumn
Entry_Item Customer.Name
Set psCaption to "Customer Name"
Set piWidth to 357
End_Object
Object oCustomer_City is a cWebColumn
Entry_Item Customer.City
Set psCaption to "City"
Set piWidth to 300
Set pbHidden to True
End_Object
Object oCustomer_Zip is a cWebColumn
Entry_Item Customer.Zip
Set psCaption to "Zip"
Set piWidth to 161
Set pbSortable to False
End_Object
Object oCustomer_Balance is a cWebColumn
Entry_Item Customer.Balance
Set psCaption to "Balance"
Set piWidth to 185
End_Object
Object oCustomer_Phone_Number is a cWebColumn
Entry_Item Customer.Phone_Number
Set psCaption to "Phone#"
Set piWidth to 209
Set pbSortable to False
End_Object
Procedure OnLoad
tWebGroupConfig[] aGroups
Get piColumnId of oCustomer_State to aGroups[0].iColumnId
Get psCaption of oCustomer_State to aGroups[0].sLabel
Move False to aGroups[0].bReverse
Get piColumnId of oCustomer_City to aGroups[1].iColumnId
Get psCaption of oCustomer_City to aGroups[1].sLabel
Move False to aGroups[1].bReverse
Send ApplyGroupConfig aGroups True
End_Procedure
End_Object
The following screenshot shows the resulting group config: