[Feature] 可以支持批量收起所有指定level的树级结构?
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 3.7k
- Forks
- 486
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 16
Description
What problem does this feature solve?
在复杂的树结构表头场景下,急需这个api来快捷收起指定层级的节点,方便用户进行阅览。
一开始我是自己实现的,我先通过getAllRowHeaderCells()来获取所有的表头,
然后通过cellHeaderPaths来判断层级,
然后遍历表头进行折叠,但是我发现个问题,在折叠/展开起一个节点之后,后面节点的col,row数据就不准了,toggleHierarchyState就没办法连续折叠了。
即
- A
- B
- C
当我处理A之后
- A
-
- A1
-
- A2
- B
- C
此时遍历处理B的时候,col和row就不对了,因为多了个A1和A2,建议支持 批量操作toggleHierarchyState,同时在增加一个 快捷收起/展开/获取指定层级的api,感谢!
What does the proposed API look like?
toggleHierarchyStateBatch ?
getHierarchyStateByHeaderLevel ?
setHierarchyStateByHeaderLevel ?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the existing getAllRowHeaderCells, cellHeaderPaths, and toggleHierarchyState APIs to understand how hierarchy levels and cell coordinates are represented. Define the batch and level-based collapse, expand, and query behavior, including how coordinates remain valid after each state change. Done means the proposed APIs handle all matching hierarchy nodes consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100