Hi Ahmed,
Greetings from Syncfusion support.
We can add event markers dynamically to the Gantt Chart. The below code snippets demonstrate how to add the event markers dynamically through a button click.
Index.cshtml
<ejs-button id="eventmarkers" content="Add EventMarkers" cssClass="e-primary"></ejs-button>
|
<script>
document.getElementById('eventmarkers').addEventListener('click', function (args) {
var ganttObj = document.getElementById('Gantt').ej2_instances[0];
ganttObj.eventMarkers = [{
day: '04/10/2019',
cssClass: 'e-custom-event-marker',
label: 'Project approval and kick-off'
}];
});
</script>
|
Similarly, you can fetch the details of the event markers from the database and set them to the Gantt Chart.
Regards,
Monisha.