But in my case, I've custom button "Add new task" and I want trigger action on this button to open new task popup. Do we've similar method same as edit task? I tried to use
gantt.addTask()
but failed.
Thanks.
Re: [REACT] Open add new task popup
Posted: Tue Jan 17, 2023 5:43 am
by tasnim
Could you please share the code of that button? What does it look like? Is it on the tbar?
Re: [REACT] Open add new task popup
Posted: Tue Jan 17, 2023 5:46 am
by hien.nguyen
Hi Tasnim,
Code is empty, I just have new custom button outside chart like below
1.png (38.18 KiB) Viewed 1644 times
Re: [REACT] Open add new task popup
Posted: Tue Jan 17, 2023 7:29 am
by tasnim
Hi,
Inside your button click fn use this code
const records = gantt.selectedRecords;
if (records.length > 0) {
gantt.editTask(records[0]);
} else {
Toast.show('No selected task found');
}