BoldDeskWe are launching BoldDesk on Product Hunt soon. Learn more & follow us.
I want to add a checkbox to the gantt chart dialog box, which I can read in the controller to check the user ticks it or not when updating, inserting or deleting a record in the dialog box. So far everything is in the default setting, and I used the e-data-manager and the controller behind to bind the data to my database:
<e-data-managerurl="/SyncfusionGantt/Url"adaptor="UrlAdaptor"batchUrl="SyncfusionGantt/BatchUrl">e-data-manager>
The BatchUrl in the controller is:
public class CRUDwhere T : class
{
public ListAddedObject { get; set; }
public ListChangedObject { get; set; }
public ListDeletedObject { get; set; }
public object key { get; set; }
public string action { get; set; }
public T Value { get; set; }
}
public IActionResult BatchUrl([FromBody] CRUDbatchmodel)
{
//how can i get the checkbox value here? I need it because it decides how I upload the data to the database
if (batchmodel.ChangedObject != null)
{
//update to database
}
...
}
Hi Desmond,
Greetings from Syncfusion support.
It is possible to render a checkbox in the Gantt columns using the editType property and then get the checkbox state in the BatchUpdate method. The column will return a value of true or false based on the checkbox state, which you can use to customize your code as needed.
Index.cshtml
<e-gantt-column field="verified" headerText="Verified" editType="booleanedit"></e-gantt-column>
|
HomeController.cs
public IActionResult BatchUpdate([FromBody]CRUDModel batchmodel) { if (batchmodel.Changed != null) { for (var i = 0; i < batchmodel.Changed.Count(); i++) { var value = batchmodel.Changed[i]; GanttDataSource result = DataList.Where(or => or.taskId == value.taskId).FirstOrDefault(); result.taskId = value.taskId; result.taskName = value.taskName; result.startDate = value.startDate; result.endDate = value.endDate; result.duration = value.duration; result.progress = value.progress; result.predecessor = value.predecessor; result.resources = value.resources; result.parentID = value.parentID; result.verified = value.verified; } }
… }
|
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/F_1798651789524864
Online Documentation: https://ej2.syncfusion.com/aspnetcore/documentation/gantt/managing-tasks/task-bar-editing#cell-edit-type-and-its-params
Regards,
Monisha.