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

建议:treeTable组件在isSimpleData时智能判断root节点,不需要用rootPid指定根节点 #1825

Closed
4 tasks done
gmxyb opened this issue Apr 23, 2024 · 2 comments
Closed
4 tasks done
Labels
enhancement 改进或增强

Comments

@gmxyb
Copy link

gmxyb commented Apr 23, 2024

议题条件

  • 我确认已查看官方使用文档:https://layui.dev ,但没有找到相关解决方案。
  • 我确认已在 Issues 中搜索过类似的问题,但没有找到相关解决方案。
  • 我已仔细阅读: 🍀 Layui Issue 贡献指南

议题类型

功能请求

使用版本

v2.9.8

问题描述

treeTable组件在isSimpleData时,使用 id, pid 指明父子关系,root 节点的 pid 如果不是 null 则需要单独用rootPid指定值,这是完全没有必要的,因为根据 pid 找不到父节点的,都可以算作 root 节点,这样可以简化设置,提高容错能力。

业务代码

treeTable.render({
  elem: '',
  tree: { // treeTable 特定属性集
    customName: {},
    data: { rootPid: "0" }, // 用于设置根节点的 pid 属性值【没有必要】
    view: {},
    async: {},
    callback: {}
  },
  // 其他 table 属性
});

截图补充

No response

浏览器

通用

演示地址

No response

友好承诺

  • 我承诺将本着相互尊重、理解和友善的态度进行交流,共同维护 Layui 良好的社区氛围。
@Sight-wcg Sight-wcg added the enhancement 改进或增强 label Apr 23, 2024
@Sight-wcg
Copy link
Collaborator

虽然实现很简单,但 rootPid 可能有其他设计用途,所以暂时不会支持。

@Sight-wcg
Copy link
Collaborator

ref: #1912

@Sight-wcg Sight-wcg closed this as not planned Won't fix, can't repro, duplicate, stale May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 改进或增强
Projects
None yet
Development

No branches or pull requests

2 participants