Skip to content

API

属性

NameDescriptionTypeDefault
getRowId返回行id() => string
rows行数据RowData[]
columns表格部分的列数据, 可查阅ag-grid v30.0.6ColDef[]
defaultCol默认列数据DefaultColDef
rowHeight每行的高度number25
headerHeight甘特图头部高度number25
rowBuffer渲染区域之外的行缓存数number5
rowSelection行选择single / multiple / nonemultiple
defaultTableViewWidth表格默认宽度number350
maxTableViewWidth表格最大宽度number1000
defaultPerHourSpacing每小时的显示间距number0.1
defaultTimeScale默认的时间轴单位day / week / month / quarter/ year
styleOption甘特图全局样式GanttStyleOption
defaultShowFirstLevel默认是否显示第一级头部booleantrue
locale国际化en / zh-cnbrowser's language
timePointComp时间点组件Comp
getEmptyRows返回空白行(count: number) => RowData[]
timeLineRender自定义时间线组件Comp
timeLineRenderParams自定义时间线组件参数Record<string, any>

事件

NameDescriptionType
select-change当用户点击行时触发(selectedIds: string[]) => void
expand-change当行的展开状态变化时触发(unExpandRowIds: string[]) => void
row-context-menu当用户右键点击行时触发(e: MouseEvent, rowId?: string | null) => void
cell-double-clicked当用户双击行时触发(rowData: RowData | undefined, columnData?: ColDef) => void
gantt-mouse-down当用户按下鼠标时触发(e: MouseEvent, rowId?: string | null) => void
time-point-move-finished当时间点移动后触发(timePoint: TimePoint, date: dayjs.Dayjs) => void
per-hour-spacing-change当时间轴变化时触发(perHourSpacing: number) => void
time-point-context-menu当用户右键点击时间点时触发(e: MouseEvent, timePoints: TimePoint[], rowData?: RowData) => void
time-line-stretch-change当时间线被拉伸时触发(rowId: string, timeLineIds: string[], startDate: dayjs.Dayjs | null, endDate: dayjs.Dayjs | null) => void
time-line-move-change当时间线被移动时触发(rowId: string, timeLineIds: string[], movedTimeData: MovedTimeLineData[]) => void
view-port-changed当渲染区域的行发生变化时触发(data: RowData[]) => void | Promise<void>

Exposes

MethodDescriptionType
getRowNode根据行id获取行节点(id: string) => GanttRowNode<RowData> | undefined
getRowNodeChildren获取行的子节点(parentId?: string) => GanttRowNode<RowData>[]
getRowDataList以平摊数组的形式返回行原始数据() => RowData[]
freshRowNodes当行数据更新时刷新显示(rows: RowData[]) => void
refreshCells刷新单元格显示 (ids: string[], force?: boolean) => void
getDisplayRows获取渲染区域的行数据() => RowData[] | null
expandAll展开所有行() => void
freshTimeLines刷新时间线显示(当时间点变化时)(rowIds: string[]) => void
selectRows根据id选择指定行(ids: string[]) => void

基于 MIT 许可发布