Our state of the art Gantt chart


Post by Nualis »

Hi,

Can you show us how the dynamically change the list of items of a dropdown when doing an inline edit action within the grid of the Gantt control? Depending of a type field we want to show different items in the list, when a user performs an inline edit on a task.

For the context menu there is a 'processitems' function. Does something similiar exists for controlling the items of the combobox or can we use some event (we've tried the 'beforeCellEditStart' without any success though)?

Below the custom column code.
import { TreeColumn, ColumnStore } from 'bryntum-gantt';
export default class NameExtColumn extends TreeColumn {
    static get type() {
        return 'nameExtColumn';
    }

    static get isGanttColumn() {
        return true;
    }

    static get defaults() {
        return {
            text: 'NameExtColumn',
            editor: {
                type: 'dropdown',
                items: 
                [
                    { value: "Definition", text: "Definition" },
                    { value: "Finalizing", text: "Finalizing" },
                    { value: "Follow up", text: "Follow up" },
                    { value: "Initiative", text: "Initiative" },
                    { value: "Realization", text: "Realization" },
                    { value: "Review",  text: "Review" }]                               
            }
        }
    }
    renderer({ value }) {
        return value;
    }
}

ColumnStore.registerColumnType(NameExtColumn);

Post by saki »

The column editor `dropdown` is same as `combo` so it has a store which stores the items. You can access this store at runtime and dynamically change its items.

Post Reply