Cannot edit the record in Gantt Chart

Hello.
I am using a Gantt Chart component to visualize the todotasks.
These are my dialog fields

addDialogFields:[
{type: 'General',headerText: 'Information obligatoire',fields:['title','teamName','userName','startDate','endDate']},
{type: 'Custom',headerText : 'Information supplementaire',fields:['deadline','status','workload','url','percent']},
{type: 'Notes',headerText:'Description'},
],
editDialogFields: [
{type: 'General',headerText: 'Information obligatoire',fields:['title','teamName','userName','startDate','endDate'],
{type: 'Custom',headerText : 'Information supplementaire',fields:['status','workload','url','percent']},
{type: 'Notes',headerText:'Description'},
]


I am also using dropwdown list for teamName and userName fields with teamParameters for edit for teamName

attribute and teamMemberParameters for edit for userName:



teamParameters:{
create: () => {
teamsElement = document.createElement('input');
return teamsElement;
},
read: () => {
return teamsObj.text;
},
destroy: () => {
teamsObj.destroy();
},
write: () => {
teamsObj = new DropDownList({
dataSource: this.teamsOfProject,
required:true,
fields: { value: 'name', text: 'name' },
change:()=>{
this.chosenTeam=this.teamsOfProject.filter(element=>element.name===teamsObj.value)[0]
this.teamMembersOfChoosenTeam=this.chosenTeam.members
teamMemberObj.dataSource=this.teamMembersOfChoosenTeam
teamMemberObj.enabled = true;
},
placeholder: "Choisir l'equipe",
floatLabelType: 'Never'});
teamsObj.appendTo(teamsElement);
}
}


teamMemberParameters:{
create: () => {
teamMemberElement = document.createElement('input');
return teamMemberElement;
},
read: () => {
return teamMemberObj.text;
},
destroy: () => {
teamMemberObj.destroy();
},
write: () => {
teamMemberObj = new DropDownList({
dataSource: [],
required:true,
fields: { value: 'email', text: 'name' },
enabled: false,
placeholder: "Choisir un membre de l'equipe",
floatLabelType: 'Never',
//value://current user
});
teamMemberObj.appendTo(teamMemberElement);
}
}
};



And I am getting an error while editing the record that :

Cannot read properties of undefined (reading 'replace')

I provided an image of error to make search more easy for you.



P.S: Also ,I would like to know how can I make a field required in DialogFields please.

Than ks for your

solution.


6 Replies 1 reply marked as answer

GM Gopinath Munusamy Syncfusion Team August 17, 2022 03:42 PM UTC

Hi Nurbek,


Greetings from Syncfusion support.

We need time to validate the reported issue and will share further details within one business days on 18th August 2022. Until then we appreciate your patience.


Regards,

Gopinath M



GM Gopinath Munusamy Syncfusion Team August 18, 2022 01:09 PM UTC

Hi Nurbek,

Query

Solution

  1. I am also using dropwdown list for teamName and userName fields with teamParameters for edit for  teamName attribute and teamMemberParameters for edit for userName.And I am getting an error while editing the record that: Cannot read properties of undefined (reading 'replace')

We have checked with issue you have reported. However, we cannot able to replicate the reported issue. We have attached the sample for your reference and we request you to share below details, which will be useful for us to provide you with a better solution.

 

1.      Code snippets of Gantt rendering code in your application.

2.      Video demonstration of the issue.

3.      Modify the attached sample as issue replicable, if possible.

Sample: https://www.syncfusion.com/downloads/support/forum/176851/ze/Vue_Gantt10257899.zip

Also please check whether TaskID is mapped in the taskFields and editSettings is enabled in your sample.

  1. Also ,I would like to know how can I make a field required in DialogFields please.

As of now, we do not have complete support for this. We already have logged a feature request for the requirement. You can track the status of the feature from below feedback link.

 

Feedback: https://www.syncfusion.com/feedback/15480/provide-support-for-custom-validation-in-add-edit-dialog

 

However, we do not have any immediate plan to implement this feature. At the planning stage for every release cycle, we review all open features and implement the features based on feature rank, customer requested count, and volume wish-list.

 


Regards,

Gopinath M



NU Nurbek August 18, 2022 02:04 PM UTC

Here I provided the current state of code and video of error.Impossible to upload ay kind of archive ,can I send you by email ?Thank you for help.



GM Gopinath Munusamy Syncfusion Team August 19, 2022 06:36 AM UTC

Hi Nurbek,


This issue occurs because editing requires a primary key column. By default, the TaskId column will be the primary key column. You can avoid this by either setting the visibility of the TaskId column as false or you can set another column as the primary key column by mapping the IsPrimaryKey field to another column. By doing this, you do not have to map the TaskId column. For more details, please refer to our Online Documentation.


Online Documentation: https://ej2.syncfusion.com/vue/documentation/gantt/managing-tasks/#troubleshoot-editing-works-only-when-primary-key-column-is-defined


If you still facing this issue, please share the code snippets and issue replicable video to this email ID([email protected]).


Regards,

Gopinath M


Marked as answer

NU Nurbek replied to Gopinath Munusamy August 19, 2022 07:55 AM UTC

Thank you for your answer,I resolved my problem.

By the way ,Are this property spreading on dependency creation?Please,look at this issue for more information.

https://www.syncfusion.com/forums/176879/how-to-custom-the-dependency-parameters-in-add-edit-dialog-fields



GM Gopinath Munusamy Syncfusion Team August 22, 2022 02:10 PM UTC

Hi Nurbek,


Most welcome. We will provide further updates regarding dependency in the respective forum. Please get back to us if you have any other queries regarding this forum.


Regards,

Gopinath M


Loader.
Up arrow icon