а

onTaskSelected background color focus


#1

Hello,
I want to change the background color when gantt loses focus, it is possible?
I mean, I changed the css for the task selection so when I select one task, the selection appears to be blue. But what i want to do is, after that, when i click outside of gantt, I want that color to change to gray (when gantt loses focus).
It is possible?

Thanks, Inês.


#2

Hello Inês,
Gantt doesn’t have a method to detect that it loses focus.
You need to manually detect the mouse position and when the mouse leaves or enters Gantt container, you need to change the style for the selected tasks and repaint the changes.
Here is an example of how it might be implemented:
http://snippet.dhtmlx.com/ba7dc092e