Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to switch the selected status of a task? #92

Open
Hsensor opened this issue Feb 11, 2023 · 1 comment
Open

How to switch the selected status of a task? #92

Hsensor opened this issue Feb 11, 2023 · 1 comment

Comments

@Hsensor
Copy link

Hsensor commented Feb 11, 2023

The onTaskClick method uses gantt.selectTask by default, so how can I toggle the selected/unselected of task !
Why doesn't the onClick method implement toggle the status of the task?

Thank you very much for your reply ! I wish you all the best !

@gearcoded
Copy link

@Hsensor,
You can use the selectTask method to select a task and unselectTask to unselect it:
https://docs.dhtmlx.com/gantt/api__gantt_selecttask.html
https://docs.dhtmlx.com/gantt/api__gantt_unselecttask.html

If you want to unselect a task after clicking on it, you can do it after a timeout:
https://snippet.dhtmlx.com/zaftythc

If you enable the multiselect extension, you will be able to select or unselect a task by holding the Control key and clicking on a task:
https://docs.dhtmlx.com/gantt/desktop__multiselection.html
Here is a sample:
https://docs.dhtmlx.com/gantt/samples/02_extensions/09_multiselection.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants