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.

For DateTimeBoxthe 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 and DateTimeBox) 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 is used to set start and end dates):


//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);

Last updated