pro-components icon indicating copy to clipboard operation
pro-components copied to clipboard

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

Open jinsu009 opened this issue 1 year ago • 2 comments

提问前先看看:

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

jinsu009 avatar Apr 02 '24 07:04 jinsu009

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 avatar Apr 16 '24 11:04 loki344

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; };

loki344 avatar Apr 16 '24 11:04 loki344