# GroupGridColumns

### GroupGridColumns

A comma separated list of columns, that should be used for grouping. By default the grouping criteria will be the cell values for this column. The same cell values are put in one group. The column itself will be hidden from view because it will only show the group name. If a search is added to the column, the column stays visible.&#x20;

For [datetimebox](../../../client-api-reference/controls/datetimebox "mention")the grouping value is set to the date part only and the column stays visible in order not to lose the time information.



For columns with date controls ([datebox](../../../client-api-reference/controls/datebox "mention") and [datetimebox](../../../client-api-reference/controls/datetimebox "mention")) an individual grouping can be tailored to the specific data. This way date ranges can be shown in groups. e.g. "today", "this week", "last month". The brixxApi call 'gridColumnConfig' enables setting of this individual grouping  ranges. \
\
Example setup for date grouping (Note: [the-moment.js-library](../../../client-api-reference/tips-and-tricks/date-and-time/the-moment.js-library "mention") is used to set start and end dates):

```javascript

//Code should be placed as event "onAppStart"

//each entry within 'grouping' must have an array. First element is start date for
//the group and second the end date. If groups overlab (e.g. "today", "this week", "this month")
//the first matching entry is picked.

columnAddOnSettings = {
    //add some grouping criteria for this date column 
    'grouping':{
        'Future Dates': [moment().add(1, 'days'), moment('9999-12-31')],
        'Today': [moment(), moment()],
        'Last 7 days': [moment().subtract(6, 'days'), moment()],
        'This Month': [moment().startOf('month'), moment().endOf('month')],
        'This Year': [moment().startOf('year'), moment().endOf('year')],
        'Last Year and Older': [moment('1970-01-01'), moment().endOf('year').subtract(1, 'year')]
    }
};

brixxApi.gridColumnConfig ('testGrid1', 'cmpSomeDate', columnAddOnSettings);
```
