HI
Steps to Reproduce
1. Run the project(npm Install , run ng s ) - Angular Project
2. Select the WBS:W3 Task .
3. Click on Edit Task
4. Give Some Value in WBS weightage Field
5. Click on Save System will stop responding
. From my point what i think on below method but don't know the exact issue
As i am not loading the task data at once on loading it on demand . So on above method i am making async await call to server and getting the data and putting it on task.
I don't think that the listener itself can be an async function. Try to install listener as a normal function and handle the async requirements from within the listener.
Hello.
I cannot reproduce this problem on the provided test case. Please amend.
Also I'd like to point out that async listeners are not supported. More precisely, promise returned from async functions is ignored.
Hi Maxim
Steps to Reproduce
Run the project
1. Select WBS: W1 -click on Edit and save
2. Select WBS: W2 - click on Edit and Save
3. Select WBS:W3 task which is under - WBS W2
4. Click on Edit and system hangs on
Problem :I wanted to load the task data on demand not all the data of a task at once . I.e to show the values in task Editor .
Reproduced.
Problem is that you are manipulating inner state of the task edit feature, setting taskEdit._editing flag to false, editor falls into infinite loop of rescheduling target task. You need to return false from beforeTaskEdit listener if your event is not yet loaded. That would prevent unnesessary editing window.
Also I need to warn you, that using private API (like _editing property) is not very robust. Private APIs might break unexpectedly when you upgrage gantt to next version and we only warn about public API changes. I recommend to stick to public API as much as possible.
Thanks
I tried but its not working out. Now it does not show the editor only .
Problem : I have to data the task data before showing it in the Edtitor . So i am doing it like this.
What will the best way to do this pleas let me know .
Attach is project where i have implemented .
gantt.on({
beforeTaskEdit({ taskRecord }) {
if (!taskRecord.dataLoaded) {
gantt.mask();
loadTask(taskRecord); // this would open task editor asynchronously, when it is loaded
return false; // return false to prevent opening dialog first time
}
}
});
async loadTask(record) {
// load record asynchronously, need method first to return false to prevent opening editor
await ....
gantt.taskEdit.editTask(record);
}