<ej:Gantt ID="Gantt" runat="server"
ActionComplete="ActionComplete">
<AddDialogFields>
<ej:AddDialogField Field="Id" />
<ej:AddDialogField Field="Name" />
<ej:AddDialogField Field="PercentDont" />
</AddDialogFields>
</ej:Gantt>
function ActionComplete(args) {
var ganttObj = $("#Gantt").data("ejGantt");
if (args.requestType === 'save' && args.addedRecord) {
var ganttRecord = args.addedRecord.item;
if (args.addedRecord.parentItem)
ganttRecord["ParentId"] = args.addedRecord.parentItem.taskId;
$.ajax({
type: "POST",
url: "GanttSample.aspx/getDate",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (result) {
ganttRecord.StartDate = result.d.startdate;
ganttRecord.EndDate = result.d.enddate;
PageMethods.AddIt(ganttRecord);
var obj = $("#Gantt").data("ejGantt");
obj.reRenderChart();
},
failure: function (response) {
alert(response.d);
}
})
}
}
|