3. Grouping rows to tree
Grouping rows according to the same values in selected columns
Setting grouping
Row grouping can be set per row part as list of column ids in Group attribute.
To assign an object to row part that already defined rows in array use the part id with "_" suffix, e.g. Body: [...], Body_Cfg: { Group:"C,D" }
Changing grouping
To permit users to change grouping use some Toolbar.
To permit dropping columns to group by them, define Toolbar with D: Group. This toolbar shows cells with D: "DragGroup".
To let users to choose some predefined grouping, add Tool cell with D: GroupList to any Toolbar and define its List attribute with the predefined groupings.
To let users to change grouping settings and / or switch grouping on / off add Tool cell with D: Group to any Toolbar.
Where to show tree
If the grouped row part has set Tree attribute, the tree is shown here.
Otherwise the tree is shown in column set by row part attribute GroupTree or in the first column from left.
Tree can be shown also in every grouped column if set row part attribute GroupTrees.
The column showing group tree can change its width by its GroupWidth, if set to -1, the column width accomodates the widths of columns hidden by grouping.
Grouping settings
Some of the global grouping setting can be changed by users in popup menu for Tool cell D: Group.
When comparing values for grouping it is possible to ignore case (Cfg GroupCaseSensitive, column CaseSensitive),
diacritics (Cfg GroupLocaleCompare, column LocaleCompare),
some characters (usually spaces) (Cfg GroupWhiteChars , column WhiteChars), etc.
To change the way the cell values are compared, set cell attribute SortValue to use this value instead of the cell value for comparing.
Grouping restrictions
To restrict some column to group by it set its attribute NoGroupBy.
To restrict some row to be grouped set its attribute NoGroup.
Creating group rows
When grouping, new parent row with D: Group is created for every group level and different group.
To not create the parent group rows set Cfg attribute GroupAdd = 0. In this case the first data row in the group becomes parent of the next rows in the same group.
To not create the parent group rows for some values, set them in Cfg GroupExclude.
To not create the parent group rows with only one child set Cfg GroupSingle = 0.
To not create the parent group rows as the only child of their parent set Cfg GroupSole = 0.
-
Create more group levels per one column
The cell value can be split for grouping to more values to be used as standalone grouping levels by separator in column attribute GroupChar
or by number of characters set by column attribute GroupMaxChars.