Our state of the art Gantt chart


Post by JSureka »

Hi
In TaskEditor - is it possible to open particular tab.
Ex: I need to open Predecessor Tab in TaskEditor directly instead of opening taskeditor and navigating between tabs.
Is there anything I can add in the below code

taskMenu: {
    items: {
        editTask: {
            text: "Edit",
            icon: false,
            menu: {
                items: {
                    generalTab: {
                        text: "General Tab",
                    },
                    predecessorsTab: {
                        text: "Predecessor Tab",
                    },
                    resourcesTab: {
                        text: "Schedule Tab",
                    },
                },
            },
        },
        add: false,
        convertToMilestone: false,
        indent: false,
        outdent: false,
        deleteTask: false,
    },
}, //end of task menu
Attachments
taskedit.png
taskedit.png (11.05 KiB) Viewed 365 times

Post by alex.l »

Hi JSureka,

You might set activeTab and open the taskEditor on the tab you need. Removing/hiding/disabling important build-in tabs, like generalTab is not supported from the box and may be buggy, but you could try to do it and handle possible problems.
This event https://bryntum.com/docs/gantt/#Gantt/feature/TaskEdit#event-beforeTaskEditShow is perfect place for that logic:

this.gantt.ganttInstance.on('beforeTaskEditShow', ({
    editor
}) {
    const desiredTabIndex = 3;
    editor.widgetMap.tabs.activeTab = desiredTabIndex;
})

All the best,
Alex


Post Reply