We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

1) Error nameSpace is undefined when trying to change taskbar lenght. 2)How to get the value changed?

Hi guys,

I need some help.

In my angular application, after showing the data in the gantt chart, If I try to change the length of the taskbar, I see in the console the following error:

ERROR TypeError: nameSpace is undefined

What does it means?

Am I missing something?

I've allowTaskbarEditing set to true.


2) When I change the length of the taskbar, how can I get the the new duration value?

Thank you!


5 Replies

UA Udhayakumar Anand Syncfusion Team April 25, 2023 09:48 AM UTC

Hi Matteo

Thank you for reaching out to us regarding the issue you encountered with your Gantt chart in your Angular application.

Based on your previous conversation, we understand that you are receiving an error message "ERROR TypeError: nameSpace is undefined" when attempting to change the length of the taskbar in your Gantt chart. In order to provide you with the appropriate solution, we kindly request you to provide us with additional information as listed below:

  1. Are you sure that you’ve mapped correct field in the taskfields
  2. Code snippet of the datasource that you use
  3. Could you please modify the sample provided and replicate the issue, which will be helpful for us to validate further
  4. In which way you’re trying to change the length of the taskbar
  5. Video demonstration of the issue
  6. Version of the Gantt that you use
  7. Angular version

Sample Link  : https://stackblitz.com/edit/angular-ogao9t?file=src%2Fmain.ts



MZ matteo z. April 26, 2023 03:38 PM UTC

thank you for the reply. Apparently the nameSpace problem was solved thanks to a lot of trials. (I'm not sure which was the right cause)

For this second question:

2) When I change the length of the taskbar, how can I get the the new duration value?

How can I do it?

Because I tryed to pass an event in actionComplete(event). But it doesn't seems to work

<ejs-gantt id="ganttDefault" [dataSource]="data5" [taskFields]="taskSettings" [columns]="columns"
[timelineSettings]="timelineSettings" [labelSettings]="labelSettings" [treeColumnIndex]="1"
height="450px" [allowSelection]="true" [projectStartDate]="projectStartDate" [projectEndDate]="projectEndDate" [highlightWeekends]="true"
[gridLines]="gridLines" [eventMarkers]="eventMarkers" [editSettings]="editSettings"
[toolbar]="toolbar" [resourceFields] = "resourceFields"
[resources]="resources" [splitterSettings]="splitterSettings" [dayWorkingTime]="workingTime" [workWeek]="workWeek" [durationUnit] = "durationUnit"

actionComplete(): void {
console.log('Gantt actionComplete event called

Which kind on event should I pass as a parameter for understanding the new dates and/or the new duration of the task bar?




ok I understood that if I pass the chart itself as an argument I can check the value:


and see that the value is different. now the question is.. 

how can I understand previously which updatedRecord to watch?

if I've 10000 records I want to check only the changed one! Any Idea?



UA Udhayakumar Anand Syncfusion Team April 27, 2023 09:52 AM UTC


We have reviewed your query and we would be happy to help you with this.

To achieve this requirement, you can use the "taskbarEdited" event of the Gantt control. Inside this event, you can get the data of the task bar which is modified and from that, you can use that value as per your requirement. We have provided a code snippet and a sample link below that can help you in this scenario:

Code Snippet :



        console.log (args.data.Duration)



Sample Link : https://stackblitz.com/edit/angular-panagz?file=src%2Fapp.component.html,src%2Fapp.component.ts

If you have any further questions or concerns, please do not hesitate to reach out to us. We are always here to help.



MZ matteo z. April 28, 2023 03:54 PM UTC

Thank you for the reply. Now works!

LA Lokesh Arjunan Syncfusion Team May 1, 2023 03:10 AM UTC

Hi Matteo

We are glad that your issue has been resolved.

Please contact us If you need further assistance.



Live Chat Icon For mobile
Up arrow icon