bryntum / support

An issues-only repository for the Bryntum project management component suite which includes powerful Grid, Scheduler, Calendar, Kanban Task Board and Gantt chart components all built in pure JS / CSS / TypeScript
https://www.bryntum.com
54 stars 6 forks source link

Crash on array column when grouping #9851

Closed marciogurka closed 2 months ago

marciogurka commented 2 months ago

Forum post

"When applying grouping on multi values cell, there is an error happen which causes the grouping to break. See attached screenshot of bug.

Here is code that I use to reproduce the bug on bryntum grid example:

import { Grid, DataGenerator } from '../../build/grid.module.js?478494';
import shared from '../_shared/shared.module.js?478494';

const skills = ["table/grid", "filter", "ui"];
const
    grid           = new Grid({
        appendTo : 'container',
        columns : [
            { text : 'Name (not groupable)', field : 'name', flex : 1, groupable : false },
            {
                type  : 'number',
                text  : 'Age',
                field : 'age',
                align : 'right',
                width : 70,
                min   : 1
            },
            {
                type    : 'widget',
                text    : 'Skills',
                field   : 'skills',
                width   : 340,
                widgets : [{
                    type           : 'chipview',
                    valueProperty  : 'items',
                    itemsFocusable : false,
                    navigator      : null,
                    closable       : false,
                    style          : {
                        flexFlow : 'row wrap',
                        display  : 'flex',
                        padding  : '5px 0 3px 0'
                    }
                }],
                cellEditor : {
                    // The editable ChipView auto heights and may overflow the cell height.
                    matchSize : {
                        height : false
                    }
                },
                editor : {
                    type        : 'combo',
                    multiSelect : true,
                    editable    : false,
                    items       : skills
                }
            },
        ],

    store : {
        data : [
            { id: 1, name: "Test 1", skills: ["table/grid", "filter", "ui"]},
            { id: 2, name: "Test 2", skills: ["ui"]},
        ]
    }
});

As per my investigation on this issue, it appears that there is a conflict between the group value and filter function when bryntum try to build group header and retrieving the record value using rec[groupValue]." Screenshot 2024-08-19 165642.png