如何在 flexganttfx 中设置对特定 activity 的关注

How to set focus on specific activity in flexganttfx

我正在使用 Flexganttfx,我想在单击某个术语时滑动到甘特图中的特定 activity(该术语不在甘特图中,但包含 activity 的参考=15=] 我要滑动到的对象)。

如何操作?

我在 flexganttfx 的论坛上找到了答案:

"there is no utility method for doing this, yet. You will need to call scrollTo() on the tree table view and then request a specific time on the timeline (Timeline.showTime())."

http://dlsc.com/forums/topic/setselectedactivity-scroll-to-row-and-activity/

就我而言:

int rowIndex = gantt.getTreeTable().getRow(treeItem);
gantt.getTreeTable().scrollTo(rowIndex);
gantt.getTimeline().showTime(date);

这解决了我的问题,我希望能帮助别人:)