I’m encountering an issue with calculating the targetIndex
in the onAfterTaskDrag
event when row heights vary. Currently, I’m using the following code:
const target_index = Math.floor(y_pos / gantt.config.row_height);
let target_task = gantt.getTaskByIndex(target_index);
This approach works well when all rows have the same height. However, in my use case, some rows have different heights due to custom styling or expanded tasks, making it difficult to calculate the target_index
based on gantt.config.row_height
.
I need to find a way to dynamically determine the correct targetedIndex
when row heights are no longer uniform.
Has anyone encountered this issue, or could you suggest an alternative method to achieve this?
Any help or guidance would be greatly appreciated!