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

ProTable column配置项 search.transform 当自定义renderFormItem输入组件的时候,不生效 #2634

Closed
brownbo opened this issue Apr 28, 2021 · 3 comments

Comments

@brownbo
Copy link

brownbo commented Apr 28, 2021

🧐 问题描述

search.transform 当自定义renderFormItem输入组件的时候,不生效
版本号@ant-design/[email protected]

💻 示例代码

 {
    title: '更新时间',
    key: 'time',
    hideInTable: true,
    renderFormItem: () => {
      return <RangePickerWith2Comp />;
    },
    search: {
      //不生效
      transform: (value: any) => {
        return {
          d: moment(value.startDate).format('YYYY-MM-DD'),
          b: moment(value.endDate).format('YYYY-MM-DD'),
        };
      },
    },
  }
@brownbo brownbo changed the title search.transform 当自定义renderFormItem输入组件的时候,不生效 ProTable column配置项 search.transform 当自定义renderFormItem输入组件的时候,不生效 Apr 28, 2021
@brownbo
Copy link
Author

brownbo commented Apr 28, 2021

image
看源代码,有个这个注释,然后修改成数组后,解决问题。

@brownbo brownbo closed this as completed Apr 28, 2021
@binbin1015
Copy link

可以贴一下具体解决代码吗

@LLmoskk
Copy link

LLmoskk commented Nov 13, 2024

可以贴一下具体解决代码吗
把你的自定义renderFormItem返回的数据结构改成数组就好
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants