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

Allow ExpandIcon to be overridden #186

Closed
hrgui opened this issue Feb 16, 2018 · 3 comments
Closed

Allow ExpandIcon to be overridden #186

hrgui opened this issue Feb 16, 2018 · 3 comments

Comments

@hrgui
Copy link

hrgui commented Feb 16, 2018

Use case
Need to use a different icon for the expand button.

Ideas

Add a rendering method expandCellRender

  1. Add new property expandCellRender, PropTypes.Function that has the following props: { prefixCls, expanded, record, needIndentSpaced }
  2. If expandCellRender is passed, then instead of rendering ExpandIcon, just call expandCellRender. https://github.com/react-component/table/blob/master/src/ExpandableRow.js#L69

advantage: allows flexibility
disadvantage: requires work in rc-table

Option 2, requires no work on rc-table

  • override rc-table-row-expand-icon rc-table-row-expanded and rc-table-row-expand-icon rc-table-row-collapsed via CSS

advantage: no work in rc-table
disadvantage: content is text only

@sytolk
Copy link

sytolk commented Nov 8, 2018

@hrgui do you have an example for Option: 2? How to override css classes used in react component

@hrgui
Copy link
Author

hrgui commented Nov 8, 2018

Closing since its resolved in #236

@hrgui hrgui closed this as completed Nov 8, 2018
@sytolk
Copy link

sytolk commented Nov 9, 2018

This fix not work with children

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

2 participants