Skip to content

columnClassName attr is cleared when customEditor is enabled #892

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

Closed
jsangilve opened this issue Dec 14, 2016 · 6 comments
Closed

columnClassName attr is cleared when customEditor is enabled #892

jsangilve opened this issue Dec 14, 2016 · 6 comments

Comments

@jsangilve
Copy link
Contributor

I noticed that using customEditor attribute of TableHeaderColumn, when a cell gets into edit mode (customEditor is enabled), the <td>s className defined by columnClassName attribute is cleared. Once the cell isn't being edited anymore, the className is restored.

<TableHeaderColumn
  key={'column-' + h.id}
  columnClassName={(h.cellEditor) ? 'editable-td': ''}
  customEditor={this.formatEditor(h.id, h.cellEditor)}>
  {h.label}
</TableHeaderColumn>

Is there any way to keep the className in edit mode or pass a className to the <td> element when cell is in edit mode?

@AllenFang
Copy link
Owner

@jsangilve, I'll improve it, actually it's not lost or override the classname on editing, because it's different component between the normal cell and editing cell. There're some solution, but as my consideration, I'll prefer to add a new props called editColumnClassName to separate from the columnClassName.

@jsangilve
Copy link
Contributor Author

@AllenFang sounds good. Thanks for adding this feature!

AllenFang added a commit that referenced this issue Dec 18, 2016
@AllenFang
Copy link
Owner

Fixed on v2.7.1, check this example 👍

@jsangilve
Copy link
Contributor Author

@AllenFang I was wondering if this editColumnClassName property could also make it to branch v3.0.0. Unless you have an alternative in mind, I could PR to v3.0.0-dev if you want.

@AllenFang
Copy link
Owner

@jsangilve, https://github.com/AllenFang/react-bootstrap-table/releases/tag/v3.0.0-beta.6 check this out.

@jsangilve
Copy link
Contributor Author

@AllenFang you rock man!

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

No branches or pull requests

2 participants