Logo

    Home

    Documentation

    Use Cases

    Training

    Applications

    Release Notes

    Grouping columns: Setup groupBy

    Grouping columns: Setup groupBy

    icon
    It allows the user to group the grid content by values of the specified column.
    • 1. Summary
    • 2. Result
    • 3. Step by Step Guide
    • groupBy attribute
    • Format
    • 1st parameter: column identifier
    • 2nd parameter: aggretate mask
    • 3rd parameter: custom group format string
    • 4. Documentation

    1. Summary

    It allows the user to group the grid content by values of the specified column.

    2. Result

    image

    3. Step by Step Guide

    💡
    IMPORTANT: Does not work with grid batching. This option should be disabled.

    Works for Datagrid2, TreeGrid and PropertyGrid.

    groupBy attribute

    A new attribute was added on the SwatGrid level, groupBy

    Here, you can specify the different grid group options

    Format

    It has the following format:

    <columnId|columnName>|<aggregateString>|<customGroupFormat>

    Example:

    moduleguid|#title|

    1st parameter: column identifier

    1st parameter is mandatory; can be string (column name) or the index of the column, starting from 0. It is the only mandatory one.

    2nd parameter: aggretate mask

    2nd parameter consists of a comma-separated list of the aggregate shortcuts.

    The possible aggregate shortcuts:

    • title - displayes the group key; ALWAYS MANDATORY
    • stat_count - calculates the count of records in a group;
    • cspan (or empty quotes '') - used to not present anything in a cell (both variants lead to one and the same effect).

    Any value not known will be removed.

    ‘#’ is required in front of each entry, except for the empty string. This is added automatically if not present;

    //input
    #stat_count,invalid_entry,title
    
    //output
    #stat_count,,#title

    3rd parameter: custom group format string

    This parameter is used to specify a custom group formatting text:

    moduleguid|title|"Groupped by " + name + " count: " + count
    image

    More info from dhtmlx:

    https://docs.dhtmlx.com/grid__grouping_rows.html

    SWAT SAMPLE: SampleGridGroupByDialog

    4. Documentation

    To find more information, you can check the following documentation.

    Grid / TableGrid / Table

    Back to Use CasesUse Cases

    Back to Home Page

    Logo