and saw it not undefined but I got error as attachment.
Please share me some guide to fix it.
1.png (471.27 KiB) Viewed 394 times
Re: [REACT] Can't get Element From Task Record.
Posted: Tue Jan 31, 2023 12:12 pm
by hien.nguyen
Hi team,
Please help me.
Re: [REACT] Can't get Element From Task Record.
Posted: Tue Jan 31, 2023 1:01 pm
by tasnim
Hi,
I'm not able to reproduce the issue that you're facing. Could you please upload a runnable test case here that we can run with npm i && npm start, so we could repro the issue and debug it?
Re: [REACT] Can't get Element From Task Record.
Posted: Wed Feb 01, 2023 4:03 am
by hien.nguyen
Yes, please use
Server in nodejs_sample.zip: simple nodejs, please run by: npm i && node index.js (after extract).
Client in gantt_chart_reactjs.zip: please run npm run start
=> After app run: please open Milestone->move Task 5 under Task 6. Then you'll see error
TypeError: taskDom is undefined
1.png (76.28 KiB) Viewed 364 times
Re: [REACT] Can't get Element From Task Record.
Posted: Wed Feb 01, 2023 6:45 am
by tasnim
Hello,
I don't see any errors that the taskDom is undefined.
It changes the color correctly
Am I doing something wrong?
Re: [REACT] Can't get Element From Task Record.
Posted: Wed Feb 01, 2023 6:50 am
by hien.nguyen
Yes, it happen sometime.
Please try steps as: open npm run start -> access http://localhost:300 -> move Task 5 under Task 6 (don't do other action before this action). Or you can try to close current browser and try open new.
Re: [REACT] Can't get Element From Task Record.
Posted: Thu Feb 02, 2023 7:07 am
by alex.l
I can't reproduce the issue you mentioned. I tried many times with different tabs and browsers.
This sounds like a race condition bug. You are trying to get task DOM element, but it is not there at the moment.
I think you could better try to use https://bryntum.com/products/gantt/docs/api/Gantt/model/ProjectModel#event-dataReady event to manipulate with DOM of edited/moved tasks, since sync doesn't guarantee DOM is ready.
Re: [REACT] Can't get Element From Task Record.
Posted: Thu Feb 02, 2023 7:13 am
by hien.nguyen
Yes, do we have any option to block screen (not allow to do anything) and after data is ready we'll remove block screen.
You can review other available properties in this class, try to type "mask" into filter textfield.
Re: [REACT] Can't get Element From Task Record.
Posted: Thu Feb 02, 2023 7:41 am
by hien.nguyen
Yes, please share me sample code for:
When refresh project with gantt.refresh() then I'll show dialog to alert "Data is being refreshing" and block screen (not allow user to do any action).
When dataReady, I'll close this dialog and unblock screen.