跳到主要内容

getLayoutView

Description

根据名称返回布局视图对象

getLayoutView: (name: string) => any

Parameters

  • name - (required) string - 布局视图的名称

Returns

  • view - (object) - 布局视图对象

Example

gantt.getLayoutView("resourceTimeline").posFromDate(new Date(2025, 05, 08));
// 返回 210

gantt.getLayoutView("resourceTimeline").dateFromPos(210);
// 返回 2025年6月8日

Details

该方法允许对返回的布局视图对象应用某些方法。这些方法包括:

  • dateFromPos - 获取视图中指定水平位置的日期
  • posFromDate - 获取视图中指定日期的相对水平位置
  • getScale - 返回该视图的时间刻度配置

要将视图滚动到指定位置,请应用 scrollLayoutCell 方法。

Need help?
Got a question about the documentation? Reach out to our technical support team for help and guidance. For custom component solutions, visit the Services page.