search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Angular Gantt Chart replace onrowcreate with button

Asked by Bcos
1 year ago.

The current demo Gantt Chart is using bottom text field to create a new task

Is that any way to replace that bottom text field with a create button
After click that button will show the dialog box to input info and create a new task

Thank you.

Comment posted by Bcos
1 year ago.

Or just add a button anywhere to create a new gantt task

Answer posted by Dan Letecky [DayPilot]
1 year ago.

You can use your own button and add a new record to config.tasks property (Angular will detect the change) or you can use the direct API tasks.add() method:

Answer posted by Bcos
1 year ago.

Thanks , I able to do this on Angular 8 by refer this example

Here shared some testing code

on ts file:

@ViewChild('gantt', { static: false }) gantt: DayPilotGanttComponent;

public createTask(): void{
this.gantt.control.tasks.add(new DayPilot.Task({
id: DayPilot.guid(),
text: 'MO',
start: new DayPilot.Date().getDatePart(),
end: new DayPilot.Date().getDatePart().addDays(1),
type: 'Task'

on html file

  • gantt [config]="config" #gantt></daypilot-gantt>
  • <button

(click)="createTask()">Add Task</button>

This question is more than 3 months old and has been closed. Please create a new question if you have anything to add.