I use SCH works well.
I edited through the controls
cell edit mode in Figure 1 and Figure 2. Can work normally
ActionComplete Call to url: '@Url.Action("UpdateScheduling", "Scheduling")', Figure 3.
But I Edit Normal Editing
edit dialog Open and Editing and Click Save Figure 4.
ActionComplete not Fire Data not Update to MSSQL
Help me fix it.
Code Example Below
@(Html.EJ().Gantt("Gantt")
.TaskIdMapping("Id")
.TaskNameMapping("Name")
.StartDateMapping("StartDate")
.EndDateMapping("EndDate")
.DurationMapping("Duration")
.ProgressMapping("PercentDone")
.NotesMapping("Note")
.TreeColumnIndex(1)
.ChildMapping("Children")
.EditSettings(edit =>
{
//edit.AllowAdding(true);
edit.AllowEditing(true);
//edit.EditMode("taskbarediting");
edit.EditMode("cellediting");
//edit.EditMode("normal"); //Update the task details through edit dialog
//edit.AllowDeleting(true);
//edit.ShowDeleteConfirmDialog(true);
edit.AllowIndent(true);
})
.ToolbarSettings(toolbar =>
{
toolbar.ShowToolbar(true);
toolbar.ToolbarItems(new List<GanttToolBarItems>()
{
//GanttToolBarItems.Add,
GanttToolBarItems.Edit,
//GanttToolBarItems.Delete,
GanttToolBarItems.Save,
GanttToolBarItems.Update,
GanttToolBarItems.Indent,
GanttToolBarItems.Outdent,
GanttToolBarItems.ExpandAll,
GanttToolBarItems.CollapseAll,
GanttToolBarItems.CriticalPath
});
})
.SizeSettings(eve =>
{
eve.Height("550px");
})
.ClientSideEvents(eve =>
{
//eve.QueryTaskbarInfo("queryTaskbarInfo");
eve.ActionComplete("ActionComplete");
})
//.IncludeWeekend(true)
.WeekendBackground("rgba(116, 195, 231, 0.26)")
//.AllowSorting(false)
.EnableAltRow(true)
.AllowColumnResize(true)
//.ShowColumnChooser(true)
.AllowSelection(true)
.SelectionMode(GanttSelectionMode.Row)
.ShowProgressStatus(true)
.EnableVirtualization(false)
.AllowGanttChartEditing(true) //Update the task details by interactions such as resizing and dragging the taskbar
.EnableProgressBarResizing(true) //You can also enable or disable the progress bar resizing by using the EnableProgressBarResizing.
//.TaskSchedulingMode(GanttTaskSchedulingMode.Auto)
.EnableContextMenu(true)
.ReadOnly(ViewBag.ReadOnly)
.Datasource(ViewBag.DataSource)
)
@(Html.EJ().ScriptManager())
</div>
-----------------
function ActionComplete(args) {
if (args.requestType === 'save' && args.addedRecord) {
addedItem = args.addedRecord.item;
var addedRecord = JSON.stringify({
'Task': addedItem
//,'Resource': args.addedRecord.resourceInfo
});
$.ajax({
type: "POST",
// url: "/Scheduling/AddScheduling",//Add is Server side method
// url: '@Url.Action("AddScheduling", "Scheduling")',
url: '@Url.Action("UpdateScheduling", "Scheduling")',
data: addedRecord,
traditional: true,
contentType: 'application/json'
});
}
else if (args.requestType === 'outdent' || args.requestType === 'recordUpdate') {
var editedRecord = args.data.item;
var data = JSON.stringify({
'Task': editedRecord
//,'Resource': args.data.resourceInfo
});
$.ajax({
type: "POST",
//url: "/Scheduling/UpdateScheduling", //Update is Server side method
url: '@Url.Action("UpdateScheduling", "Scheduling")',
data: data,
traditional: true,
contentType: 'application/json'
});
}
}
Attachment:
Capture_SCH_f2459fe0.zip