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

Constrain column drag by its region #902

Open pmiklashevych opened 4 years ago

pmiklashevych commented 4 years ago

https://www.bryntum.com/forum/viewtopic.php?p=73246#p73246

https://www.bryntum.com/docs/grid/#Grid/feature/ColumnReorder https://www.bryntum.com/docs/grid/#Grid/column/Column Should have configs to prevent column region to be changed

As a workaround:

    columns : {
        data : [
            { text : 'First name', field : 'firstName', width : 180, region : 'left' },
....
        ],
        listeners : {
            beforeUpdate({ record, changes }) {
                // constrain columns to their regions
                if (changes && changes.region && changes.region !== record.region) {
                    return false;
                }
            }
        }
    },
ExtAnimal commented 4 years ago

At Sencha, any ColumnContainer (which meant either the whole header, or any group header) could be configured with sealed : true meaning that you cannot drag into it or out of it (but dragging within it is OK).

We should implement sealed on ColumnStore and Column to enforce this concept.