Support Forum
Hi
Its not happening every time as mention before. It occurs some times in which case it fails. If you have any clue regarding this then please let me know.
What i think it may be because of the below code. As the error is telling. So for the first time it returns false. And after time out it returns true.
This is the code can you let me know where it is going wrong.
Its not happening every time as mention before. It occurs some times in which case it fails. If you have any clue regarding this then please let me know.
What i think it may be because of the below code. As the error is telling. So for the first time it returns false. And after time out it returns true.
can not create property 'extraItems' on boolean false.
This is the code can you let me know where it is going wrong.
this.gantt.on("beforeTaskEdit", ({ taskEdit, taskRecord }) => {
const activityType = taskRecord.activityType;
if (!taskEdit.additionalDataLoaded) {
this.gantt.mask("Loading data ...");
// emulate async await request
setTimeout(async () => {
try {
if (!this.UOM.length) {
this.UOM = await this.service.loadUom();
}
const record = await this.service.loadActivitiyInfo(
taskRecord.ID,
this.defaultScheduleID,
this.projectID,
activityType
);
this.gantt.unmask();
taskEdit.additionalDataLoaded = true;
taskEdit._editing = false;
taskEdit.editTask(taskData);
return true;
} catch (err) {
this.gantt.unmask();
Toast.show(err.error.message);
return false;
}
}, 2000);
return false;
}
Hi
This is the config i am doing.
taskEdit: {
tabsConfig: {
resourcestab: false,
advancedtab: false
},
editorConfig: {
height: "41em",
showDeleteButton: true,
extraItems: {
generaltab: [
{
type: "textfield",
ref: "ActivityTypeField",
name: "activityType",
label: "Activity Type",
disabled: true,
flex: "1 0 50%",
cls: "b-inline"
},
Hi
I am attaching the angular Project
Steps to Run
1. Extract the project
2. Do npm Install
3. ng s - to start the project
Steps To reproduce
1. Click on Home (hyperlink)
2. Then click on Gantt (hyperlink)
3. Select task click on Edit tasks button.
4. Close Editor Pop Up
5. Repeat Step 1,2 ,3 - Check in Console you will get error. And Editor pop up will not appear.
I am attaching the angular Project
Steps to Run
1. Extract the project
2. Do npm Install
3. ng s - to start the project
Steps To reproduce
1. Click on Home (hyperlink)
2. Then click on Gantt (hyperlink)
3. Select task click on Edit tasks button.
4. Close Editor Pop Up
5. Repeat Step 1,2 ,3 - Check in Console you will get error. And Editor pop up will not appear.
- Attachments
-
- advanced.rar
- (1.81 MiB) Downloaded 113 times
Hi, rahulranjan!
I've tried your sample code. But found no errors in console flowing your steps.
I've attached a bit modified code for correct TaskModel implementation and few fixes to TaskEdit layout.
If you can reproduce error with the attached project may be you can confirm the steps again and then I can recheck.
I've tried your sample code. But found no errors in console flowing your steps.
I've attached a bit modified code for correct TaskModel implementation and few fixes to TaskEdit layout.
If you can reproduce error with the attached project may be you can confirm the steps again and then I can recheck.
- Attachments
-
- advanced-forum.rar
- (1.22 MiB) Downloaded 124 times
Hi
I have run the project. It still gives the same error
Steps to Reproduce
1. Run the project
2. Select Home
3. Then click on gantt
4. select the task
5. click on Edit button
6. close the edit pop up
7. click on Home
8. Click on gantt
9. select the task
10. Click on edit button
You will be able to see the error. Edit pop won't open.
I have run the project. It still gives the same error
Steps to Reproduce
1. Run the project
2. Select Home
3. Then click on gantt
4. select the task
5. click on Edit button
6. close the edit pop up
7. click on Home
8. Click on gantt
9. select the task
10. Click on edit button
You will be able to see the error. Edit pop won't open.
The routing of the Angular application causes that the html markup of gantt is destroyed always when the "Home" is selected and then the gantt is re-created when "Gantt" route is selected. This leads to unpredictable behavior of gantt instances piling up on each navigation. It is because ngOnInit run always when navigation to Gantt so the new instance is created.
The problem has a two possible solutions:
The problem has a two possible solutions:
- to destroy gantt on each navigating away from Gantt route
- to implement a non-destroying routing - recommended.