Hi
The args is undefined on all actions.
Used this example:
https://www.syncfusion.com/kb/5562/how-to-update-changes-from-gantt-control-to-sql-database
<ej:Gantt ID="GanttContainer" runat="server" CssClass="gantt" DataSourceID="SqlDataSource1"
AllowSelection="true"
ContextMenuOpen="contextMenuOpen"
EnableContextMenu="true"
TaskIdMapping="TaskId"
TaskNameMapping="TaskName"
StartDateMapping="StartDate"
EndDateMapping = "EndDate"
DurationMapping="Duration"
ProgressMapping="Progress"
IsResponsive="true"
BaseLineStartDate ="baselineStartDate"
BaseLineEndDate = "baselineEndDate"
ScheduleStartDate="02/03/2017"
ScheduleEndDate="03/09/2017"
ParentTaskIdMapping="ParentId"
TreeColumnIndex="1"
AllowDragAndDrop="True"
AllowGanttChartEditing="true"
Load="load"
Height="100%"
EnableResize="true"
AllowSorting="true"
AllowMultiSorting="true"
PredecessorMapping="Predecessors" ActionComplete="actioncomplete" TaskSchedulingMode="Auto">
<EditSettings AllowEditing="true" AllowAdding="true" AllowDeleting="true" AllowIndent="true" EditMode="cellEditing" />
<SizeSettings Width="100%" Height="1000px" />
<ToolbarSettings ShowToolbar="true" ToolbarItems="add,edit,delete,update,cancel,indent,outdent,collapseAll,expandAll,search" />
</ej:Gantt>
<script type = "text/javascript" >
// To update the database through dialog editing or tool bar editing
function actioncomplete(args) {
var ganttRecord = args.data;
alert(args.count);
if (args.requestType === 'save' && args.addedRecord) {
//Newly Added Record is obtained here , which can be updated to database
if (args.addedRecord.parentItem)
ganttRecord["ParentId"] = args.addedRecord.parentItem.taskId;
PageMethods.AddRecord(ganttRecord);
} else if (args.requestType === 'delete') {
var data = args.data;
var ganttRec = data.item;
PageMethods.DeleteRecord(ganttRec);
if (data.hasChildRecords) {
deleteChildRecords(data);
}
}
// To update the database during Outdent,editing,indent,predecessor update operation
else if (args.requestType === 'outdent' || args.requestType === 'recordUpdate') {
var ganttRec = args.data.item;
PageMethods.UpdateRecord(ganttRec);
}
}
//Delete inner level child records
function deleteChildRecords(record) {
var childRecords = record.childRecords,
length = childRecords.length,
count, currentRecord;
for (count = 0; count < length; count++) {
currentRecord = childRecords[count];
PageMethods.DeleteRecord(currentRecord.item);
if (currentRecord.hasChildRecords) {
deleteChildRecords(currentRecord);
}
}
}
</script>
THX
Armand