How to select a cell in the grid? (like gantt.selectTask(id))

I have enabled keyboard navigation:

gantt.config.keyboard_navigation_cells = true;

Selecting a task is simple, just use


But now I would need to programmatically select a cell in the grid. I couldn’t find anything in the documentation for this, any ideas?

Hello Frederik,
You can use the following command to change the focus:

gantt.ext.keyboardNavigation.focus{type:"taskCell", id:"task id", column:"column name"}

But that will work only if the focus is already on the Grid. You need to use a delay to after changing the focus.
The following example shows how it might work:

We’ll update the following article and mention that it is possible to specify the task cell in the focus() method:

Very nice, thanks.

And sorry, I didn’t realize that I also needed a way to get the currently selected column. Is that also possible?

Hello Fredrik:
There is no built-in method in the current version, but it will be added in the next version (6.1).
Now, you can use the internal method to get the current active cell:


Here is the snippet:

Excellent, thank you!

Hello Fredrik,
The dev team implemented a new function that returns the active cell:


Here is an example:

Unfortunately, the documentation doesn’t mention that change, but we will add it in the future.