getCellIndex()
描述
根据 id 返回 swimlane 中单元格的索引
用法
getCellIndex(
cellId: string | number,
type: string // "row" | "col"
): number | undefined;
参数
cellId- (必需)单元格的 idtype- (必需)计算索引的方向类型:"row"|"col"
返回值
该方法返回单元格的索引。索引计数从 0 开始。
示例
// 初始化图表
const diagram = new dhx.Diagram("diagram_container", {
// 配置选项
});
diagram.data.parse(data);
// 设置活动 swimlane
diagram.cellManager.setSwimlane("main");
// 获取单元格的索引
diagram.cellManager.getCellIndex("r01", "row"); // -> 0
更新日志:v4.0 中新增
相关文章:配置 Swimlanes