Tencent / Tencent/tdesign-react

[Table] 可编辑行的表格校验规则回调期望添加行信息,以便联动校验

Open
#2,726 2 comments 0 reactions 1 assignee View on GitHub

@chaishi is already working on this.

Since Jan 25, 2024.

💪🏻 enhancement
Dominant language
TypeScript
Stars
965
Forks
373
Avg merge
3d 6h
Merged PRs (30d)
17

Description

这个功能解决了什么问题

场景:可编辑表格某一 column 的校验逻辑依赖于另一个 column 的值, 在 column.edit.rules 配置自定义 validator 时,callback 只接受当前 cell 的值,无法获取当前行,故无法做当前行数据的联动校验
1706148285274

你建议的方案是什么

在自定义 validator 的 callback 传入当前 row 的数据
eg:

rules: [{ validator: (val, rowData) => val.length && rowData.orderType === 'xxx' > 0, message: 'xxxxxx' }],

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.