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
close icon

Gantt chart - Raising an event

Hi,

How do you raise an event such as 'resizing' or 'resizeStart'/'resizeEnd'?

Here is the angular template:

<ejs-gantt id="ganttDefault" [dataSource]="data" [taskFields]="taskSettings" [columns]="columns"
[timelineSettings]="timelineSettings" [labelSettings]="labelSettings" [treeColumnIndex]="1"
[allowSelection]="true" dateFormat="MMM dd, y" [projectStartDate]="projectStartDate" [projectEndDate]="projectEndDate" [highlightWeekends]="false"
[gridLines]="gridLines" [eventMarkers]="eventMarkers" [editSettings]="editSettings"
[toolbar]="toolbar" [baselineColor]='orange' [renderBaseline]="true" [includeWeekend]="true" (resizeStart)='resizeStarted($event)'>

Here is the component code:
resizeStarted($event) {
console.log('resizing started')
}

Thanks.

4 Replies

JN Joubin Najmaie July 15, 2019 08:56 PM UTC

I got a few other events firing, however I'm looking for a particular event for change of the startdate or enddate of a task.
Which event is this?

Thanks.


JA Jesus Arockia Sankaran S Syncfusion Team July 16, 2019 11:33 AM UTC

Hi Joubin, 
 
Please find the details below. 
 
No 
Query 
Syncfusion Comments 
1 
How do you raise an event such as 'resizing' or 'resizeStart'/'resizeEnd'? 
These events are get triggered on column resizing action respectively the resizeStart event gets triggered when the column resize starts, the resizing event gets triggered on resizing, and resizeStop event gets triggered when column resize ends. 
 
2 
I'm looking for a particular event for change of the startdate or enddate of a task. Which event is this? 
While changing the start date and end date, by resizing the taskbar, taskbarEditing event gets triggered. In the taskbarEditing event argument we will get the parameter called taskBarEditAction. While changing the start date the taskBarEditAction value will be LeftResizing. While changing the end date its value will be RightResizing. Using this value we can differentiate which value will be changes on taskbar resize and drag actions. 
 
On cell edit action, cellEdit event gets triggered, cellEdit event argument has the parameter named columnName. Using this parameter we can find which column will be edited. 
 
Can you please share your requirement that you want to achieve on this events? 
 
 
 
 
We ask you to get back to us if you require further assistance on this. 
 
Regards, 
Jesus Arockia Sankaran S 



JN Joubin Najmaie July 16, 2019 02:43 PM UTC

Thanks Jesus!

So far I've figured out the following:
  1. taskbarEdited: use this event for when a task is expanded or contracted.
  2. actionComplete: is a generic event fired on all actions.
I still don't know the event fired on dragging a dependency line between two tasks.

Can you please help me with that?

Thanks!


JA Jesus Arockia Sankaran S Syncfusion Team July 17, 2019 01:42 PM UTC

Hi Joubin, 
 
Please find the response below. 
 
In Gantt, we can track the predecessor draw action by using actionBegin event. This event  will be triggered before drawing the connector lines with requestType argument value as ValidateDependency. 
And the actionComplete event will be triggered after successful creation of connector lines with requestType argument value as save. 
 
Please get back to us if you require further assistance on this. 
 
Regards, 
Jesus Arockia Sankaran S 


Loader.
Live Chat Icon For mobile
Up arrow icon