How to add custom button then attach them to task

Hi everyone,

I would like to add new button +/- to every task in grid, like bellow image by js


when user click plus button, task start/end date will be plus 1 hour
when user click minus button, task start/end date will be minus 1 hour

Please help me if you guy has implemented this one. or show me guild how to do this.
Thank you very much

help me please :tired_face:

Hello,
Looks like you want to show the buttons over the task bar in the timeline area (not in the grid).
It can be implemented with the rightside and leftside text:
Here is an example where it is implemneted:
http://snippet.dhtmlx.com/5/1c5c4eb2d
You won’t see buttons above projects as they ignore start_date, end_date and duration parameters, but they depend on their children, so your changes will be reset after the next rendering.

Just in case here is an example for the grid:
http://snippet.dhtmlx.com/5/59255ee75

1 Like

excellent, thank you very much!!!

one more question, now I’m using VueJS and I put all condition and validation functions into Vue methods
How can I access Vue methods from button onclick in this case?

Hello,
Gantt doesn’t support Vue.js methods. You can try using something like

'<input type=button value="+" v-on:click=task_operations('+task.id+',"right_increase")>'

But I do not guarantee that it will work.