Skip to content

[Feature Request] Support custom field name for detail table records in Master-Detail plugin / 支持自定义主从表格插件的数据来源字段名称 #4997

@guosen2

Description

@guosen2

What problem does this feature solve?

Currently, the MasterDetailPlugin automatically looks for the children field in the main table row data to populate the detail table. This behavior is hardcoded, forcing users to rename their data fields to children even if their backend or business logic uses a different name (e.g., details, subItems, etc.).
目前 MasterDetailPlugin 固定从主表对应行数据的 children 字段中获取子表所需的记录(records)。如果原始数据中的字段名不是 children(例如是 detailsitems),用户必须手动进行数据转换,将字段名重置为 children 才能正常显示子表。

Benefit / 收益:
Avoid unnecessary data transformation and improve developer experience.
避免不必要的数据结构转换,提高接入效率。

What does the proposed API look like?

Add a configuration option, e.g., childrenKey or recordsField, to MasterDetailPlugin or DetailTableOptions to specify the field name where sub-table data is stored.
在插件配置或 DetailTableOptions 中增加一个配置项(如 childrenKey),允许自定义子表数据的字段名。

Example / 示例:

new MasterDetailPlugin({
  childrenKey: 'myCustomDetails', // New suggested option
  detailTableOptions: {
     // ...
  }
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions