ant-design / pro-components

🏆 Use Ant Design like a Pro!
https://pro-components.antdigital.dev
MIT License
4.04k stars 1.29k forks source link

🧐[问题] Please find the reset button click event in the column setting in the setting in the option in the pro table. #8268

Open jinsu009 opened 1 month ago

jinsu009 commented 1 month ago

提问前先看看:

https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md

🧐 问题描述

I would like to register another onclick event for the option initialization button. Is there a way?

💻 示例代码

🚑 其他信息

protable_issue

loki344 commented 4 weeks ago

I also need this event. We store the structure of tables in the backend on a per user basis. When they reset it, we want it to reset to the system default. I think it should be possible to insert an event listener (onXXReset) here: https://github.com/ant-design/pro-table/blob/df4fc21be7fc3b1060715920ca73765f0abaac26/src/component/columnSetting/index.tsx#L274

loki344 commented 4 weeks ago

Actually, maybe it's not even necessary. You have the option to pass in extra elements to settings. I will pass a button in with my desired event-listener attached.

export type SettingOptionType = { draggable?: boolean; checkable?: boolean; showListItemOption?: boolean; checkedReset?: boolean; listsHeight?: number; extra?: React.ReactNode; children?: React.ReactNode; settingIcon?: React.ReactNode; };