Hi friends,
I follow the guide to edit a gantt control. Server code receives items changed by batchUrl correctly. But when it's processed and return the changed items then the gantt control always show spinner load image. Debugging browser can view this error: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'replace').
Could you help me?
DataManager:
<e-data-manager url="/Gantt/Datasource/[email protected]["gantttype"]&[email protected]["id"]" adaptor="UrlAdaptor" batchUrl="/Gantt/BatchUpdate/[email protected]["gantttype"]&[email protected]["id"]"></e-data-manager>
Code behind:
public async Task<IActionResult> BatchUpdate([FromBody] ICRUDModel<Gantt> data, GanttType ganttType, int id)
{
List<Gantt> uChanged = new List<Gantt>();
if (data.Changed != null && data.Changed.Count() > 0)
{
foreach (var rec in data.Changed)
{
var task = await _context.Tasks.FindAsync(rec.taskId);
if (task != null)
{
// Update task fields
}
uChanged.Add(rec);
}
}
return Json(new { changedRecords = uChanged });
}