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 disable single task selection when I use multi-select #98

Open
guyutian opened this issue Jul 18, 2023 · 1 comment
Open

How to disable single task selection when I use multi-select #98

guyutian opened this issue Jul 18, 2023 · 1 comment

Comments

@guyutian
Copy link

hello,
How to disable single task selection when I use multi-select attribute, 'onTaskClick' event doesn't work properly

@gearcoded
Copy link

@guyutian, the onTaskClick event fires after the onBeforeTaskSelected event, so you cannot use it to cancel the task selection with ordinary clicks. You will need to use a different approach.

You can add the mousedown event handler and check if you clicked on a task bar in the timeline or on the task row in the grid. If you didn't press the Shift or Control key, you can save the task ID in a variable. Then you can return false in the onBeforeTaskSelected event handler if the ID matches the task ID.

Here is the snippet:
https://snippet.dhtmlx.com/3umuzpfw

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