I have just started using the Gantt chart but am coming up with a few issues.
v22.1.38.0
1) My dataManager url is called twice when the page loads. e.g. a full list of tasks is requested multiple times.
2) When using the context menu "add >Above or Below" the row is displayed above original task. It appears that the task that was right clicked on has the details copied (TaskName, StartDate, Duration etc). It is then immediately posted to the server, but there is no indication of direction (below or above) so we can't modify the OrderID at the server so save the position of the task.
4) I would like to create my own edit modal popup. If I modify the datasource via javascript how can I refresh the grid to display the new changes without calling the server for a full refresh?
document.getElementById('Gantt').ej2_instances[0].flatData[48].GanttDuration = 50;
calling document.getElementById('Gantt').ej2_instances[0].refresh() reads from the server again. I would like the gantt chart to just re-read the local datasource.
@(Html.EJS().Gantt("Gantt")
.DataSource(dataManager =>
{
dataManager.Url(_dataSourceUrl).BatchUrl("/Schedule/SaveGanttData").Adaptor("UrlAdaptor");
})
.Toolbar(new List<string>()
{ "CollapseAll", "ExpandAll", "Search","Add"})
.Columns(col =>
{
col.Field("GanttTaskID").HeaderText("Task ID").Width(100).Visible(true).Add();
col.Field("Header").HeaderText("Task Name").Width(250).Add();
col.Field("GanttStartDate").HeaderText("Start Date").Add();
col.Field("DateDue").HeaderText("End Date").Add();
col.Field("GanttDuration").HeaderText("Duration").Visible(false).Add();
col.Field("GanttProgress").HeaderText("Progress").Visible(false).Add();
col.Field("GanttDependency").HeaderText("Dependency").Visible(false).Add();
col.Field("GanttOrderID").HeaderText("Order").Visible(true).Add();
})
.TaskFields(ts =>
ts.Id("GanttTaskID")
.ParentID("GanttParentID")
.Name("Header")
.StartDate("GanttStartDate").EndDate("DateDue")
.BaselineStartDate("GanttBaselineStartDate").BaselineEndDate("GanttBaslineEndDate")
.Duration("GanttDuration")
.Progress("GanttProgress")
.Dependency("GanttDependency")
)
.EditSettings(es => es.AllowEditing(true).Mode(Syncfusion.EJ2.Gantt.EditMode.Auto)
.AllowTaskbarEditing(true).AllowAdding(true).AllowEditing(true).AllowDeleting(true)
)
.AllowRowDragAndDrop(true)
.AllowResizing(true)
.AllowUnscheduledTasks(true)
.EnableContextMenu(true)
.DateFormat("dd/MM/yyyy")
.RenderBaseline(true)
.HighlightWeekends(true)
.TreeColumnIndex(1)
.SplitterSettings(s => s.Position("615px"))
.DataBound("GanttChartDataBound")
.Height("100%")
.Render()
)
Tim,
Greetings from Syncfusion
You can find the query response below
|
Query 1: Data manager is calling twice |
Due to the uniqueness of this particular query, we have separated it into a distinct issue for more effective follow-up. For additional details regarding this inquiry, kindly refer to the following link.
Ticket Link : https://support.syncfusion.com/support/tickets/487527
|
|
|
Query 2 : When using the context menu "add >Above or Below" |
We have reviewed your query and you can achieve your requirement by using actionBegin event inside the actionBegin event you can take the instance of the gantt, and pass the required param as a query, you can assess the query in the controller file by using batchmodel.ej2Gantt.position
You can find the code snippet and sample link below
Sample Link : https://www.syncfusion.com/downloads/support/directtrac/general/ze/alert_msg_mvc-1700235609-309594731
|
|
|
Query 3: When drag/dropping a row the row is visually displayed correctly in the dropped position |
The Gantt chart can preserve the index position of a dropped record by modifying the database table's index position through the utilization of the "rowDrop" event. For comprehensive information regarding the implementation process, please refer to the User Guide (UG) link provided below, which contains detailed instructions and guidelines.
UG LINK: https://ej2.syncfusion.com/aspnetmvc/documentation/gantt/how-to/maintainrecordindex
|
|
|
Query 4: I would like to create my own edit modal popup |
We have reviewed your query and you can achieve your requirement by using updateRecordByID method by using this you can update the particular data without refreshing it, you can find the code snippet and sample link below
Sample Link : https://www.syncfusion.com/downloads/support/directtrac/general/ze/alert_msg_mvc-1700235609-309594731
|
Regards,
Udhayakumar