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 10 months 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