Hide/show a task on timeline with a toolbar button to toggle that

How can i add a button in left column to toggle visibility of tasks on timeline?
eg. TASK NAME / DURATION / VISIBILITY (if click here, disable task on timeline… )

its possible? has anyone done something like that?
thank everyone

i trayed add a column with this:
{name:“custom_field”, label:“Visibility”, template:function(task){
return " show/hide"}}

and a function:
function toggleVisibility(taskID) {

        $('.gantt_task_row[task_id='+taskID+']').toggleClass('disabled');
    }

and via CSS hide or customize timeline elements.

but i have 2 problems… class is change only after twice clicks … e other problem is, when i select other task, i lost any changes i made via functions, css, etc…

what i need to do to avoid this problem? dont clear when i click in other task… or, save this new atributes in gantt.

thank all

Hello Allan,
If you apply the changes by modifying the DOM structure, your changes will disappear next time Gantt repaints the chart or task row.
You need to change the task property and update the task.
Here is an example of how it might be implemented:
http://snippet.dhtmlx.com/eb6d68f7c

However, please note, that if the invisible task is linked to other tasks, its links will remain in the timeline:

To avoid that, you can unschedule the task. But in that case, you need to take care of the displayed dates:
https://docs.dhtmlx.com/gantt/desktop__unscheduled_tasks.html

Here is the snippet with that functionality:
http://snippet.dhtmlx.com/8f9335d6c