[Gantt] How to keep focus after expanding a row?


Hi all!

I want to keep row focused (yellow background) after it is expanded (clicked on the small plus icon).


Any idea? Is that possible?
Thanks a lot! Martin


Hello @InterestedDeveloper1,

By default, clicks on the open/close icons don’t invokes task selection(row focus), but you can change this behavior using the onTaskRowClick event:

All that you have to do, is check if the “row” element contains icons classes: “gantt_open”/“gantt_close” and select task in if it is.

The code may look like the following:

gantt.attachEvent("onTaskRowClick", function(id,row){
  if(row.classList.contains("gantt_open") || row.classList.contains("gantt_close"))

Here is a demo: