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

Should be possible to show chart with no columns #6978

Closed taauntik closed 8 months ago

taauntik commented 1 year ago

Forum post

Hello, Is it possible to completely remove the default "Name" column from the Gantt control and also remove the "double arrow" button between the gantt chart and the "Name" column? Please see a screenshot attached. We have a requiremet to display only the Gantt chart without any columns. BryntumGanttColumns.png

ExtAnimal commented 1 year ago

GanttBase.js needs

    changeColumns(columns, currentStore) {
        if (columns) {
            let cols = columns;

            if (!Array.isArray(columns)) {
                cols = columns.data;

                // Need to pull the taskstore in, to make sure any fields added by columns are added to it
                this._thisIsAUsedExpression(this.taskStore);
            }

            // Always include the name column
            if (!cols.some(column => {
                const constructor = column instanceof Column ? column.constructor : ColumnStore.getColumnClass(column.type) || Column;

                return constructor === NameColumn || constructor.prototype instanceof NameColumn;
            })) {
                cols.unshift({
                    type : 'name'
                });
            }
        }

        return super.changeColumns(columns || [], currentStore); // Just added " || []"
    }

Then columns : null will work.

Andemki commented 1 year ago

GanttBase.js needs

    changeColumns(columns, currentStore) {
        if (columns) {
            let cols = columns;

            if (!Array.isArray(columns)) {
                cols = columns.data;

                // Need to pull the taskstore in, to make sure any fields added by columns are added to it
                this._thisIsAUsedExpression(this.taskStore);
            }

            // Always include the name column
            if (!cols.some(column => {
                const constructor = column instanceof Column ? column.constructor : ColumnStore.getColumnClass(column.type) || Column;

                return constructor === NameColumn || constructor.prototype instanceof NameColumn;
            })) {
                cols.unshift({
                    type : 'name'
                });
            }
        }

        return super.changeColumns(columns || [], currentStore); // Just added " || []"
    }

Then columns : null will work.

@ExtAnimal, Is it something that user of the Bryntum Gantt component can add to the application where this component is used or this is an internal change for the Gantt component and can be done only by Bryntum Dev team?

Jmurawsk commented 1 year ago

@taauntik @ExtAnimal can you give us an update in this item ? We would like to use this functionality in our project.