Page 1 of 1

[REACT] How to default a Particular Tab when opening the TaskEditor?

Posted: Mon Apr 12, 2021 4:41 pm
by Gowtham

We need to default a particular tab on the Task Editor. Any idea on how to focus on the particular tab by default or it will also be dynamic.

On Right Click menu we have "Edit Resource" instead of just edit -> when click on it we have to open the Task editor popup with the "Resource tab" focused / Activetab Item.


Re: [REACT] How to default a Particular Tab when opening the TaskEditor?

Posted: Mon Apr 12, 2021 4:50 pm
by pmiklashevich

See the config and the property:
https://www.bryntum.com/docs/gantt/#Core/widget/TabPanel#config-activeTab
https://www.bryntum.com/docs/gantt/#Core/widget/TabPanel#property-activeTab

You can preconfigure the default tab, or change the active tab from the code


Re: [REACT] How to default a Particular Tab when opening the TaskEditor?

Posted: Mon Apr 12, 2021 7:27 pm
by Gowtham
pmiklashevich wrote: Mon Apr 12, 2021 4:50 pm

See the config and the property:
https://www.bryntum.com/docs/gantt/#Core/widget/TabPanel#config-activeTab
https://www.bryntum.com/docs/gantt/#Core/widget/TabPanel#property-activeTab

You can preconfigure the default tab, or change the active tab from the code

There is no such config or properties for TaskEdit

https://www.bryntum.com/docs/gantt/#Gantt/feature/TaskEdit#configs
https://www.bryntum.com/docs/gantt/#Gantt/feature/TaskEdit#properties

gantt.taskEdit.editorConfig.activeTab=2
gantt.taskEdit.activeTab=2

Also we have some hidden Bryntum tabs and added custom tabs like below

taskEdit: {
    cls: "taskeditstyle",
    activeTab: 2,
    editorConfig: {
        activeTab: 2
    },
    items: {
        deleteButton: false,
        generalTab: false,
        predecessorsTab: false,
        	TabOne:{
			type:"TabOne",
			title:"Tab One"
			weight:10
		}
		TabTwo:{
			type:"TabTwo",
			title:"My Tab"
			weight:10
		}
    }
}

If we want to select the TabTwo as selectedTab what needs to be handled?
As I mentioned there is no such config called activeTab (also index will be another problem when hiding the gantt tabs visually)


Re: [REACT] How to default a Particular Tab when opening the TaskEditor?

Posted: Tue Apr 13, 2021 6:42 am
by alex.l

Please check this thread viewtopic.php?f=52&t=16826&p=83684

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