Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

默认demo 月份视图切换到 周视图 无法切到今天 #437

Closed
calibura opened this issue Feb 1, 2024 · 1 comment
Closed

默认demo 月份视图切换到 周视图 无法切到今天 #437

calibura opened this issue Feb 1, 2024 · 1 comment

Comments

@calibura
Copy link

calibura commented Feb 1, 2024

你好,在线demo中可以重现。
发现 root.component.ts 中 ngOnInit 里用了 scrollToToday 但是没生效,尝试添加 timeout 后可以实现定位到今天,但是会·闪一下,请问有更好的方式解决吗?
image

@walkerkay
Copy link
Collaborator

切换视图并不会重新渲染组件,所以不会重新执行 ngOnInit 中的 scrollToToday(), 如果有需要可以手动调用 scrollToday() 来实现

 @ViewChild('gantt') ganttComponent: NgxGanttComponent;

 this.ganttComponent.scrollToToday();

@calibura calibura closed this as completed Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants