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

Assign className to clicked row on expand #1370

Closed
CoralSilver opened this issue Jun 1, 2017 · 17 comments
Closed

Assign className to clicked row on expand #1370

CoralSilver opened this issue Jun 1, 2017 · 17 comments

Comments

@CoralSilver
Copy link

Is there a way to add a custom background color or className to a row when a user clicks to expand it, in the same way that you can with the select row option? I just want the row to expand, and not be selectable.

@AllenFang
Copy link
Owner

HI @CoralSilver, you can use this.options.expandRowBgColor to assign the bgcolor for expanding rows but currently, we don't support the className on expanding row yet, but I can support it in near future. is that this.options.expandRowBgColor helpful to you?

@CoralSilver
Copy link
Author

Thanks Allen. Yes I am already using this.options.expandRowBgColor, but I wanted to be able to add a className to the row that it is expanding from so it is more visually obvious that they are connected.

@AllenFang
Copy link
Owner

sorry for lately reply, so you means add the class on original row instead of expanded one?

@CoralSilver
Copy link
Author

Yes exactly. And then remove it once the row is closed again.

@AllenFang
Copy link
Owner

@CoralSilver, got it, I'll try to support it as soon as possible.

@CoralSilver
Copy link
Author

Thanks!

@AllenFang
Copy link
Owner

@CoralSilver, this feature was supported on v3.4.0, check this as example, thanks

@CoralSilver
Copy link
Author

Thanks Allen. Works perfectly!

@supiash1
Copy link

@AllenFang Thanks for your response, The class is added on the tr after expanding is there a way we could add the class when the table is rendered and stays whether it expands or not please?

@supiash1
Copy link

@AllenFang Thanks for your response
screen shot 2017-06-14 at 16 05 34

As In the picture the expand component will be attached as tr in the main table and hidden next to the expandable row, i would like to add the class on it even when it is not expanded

The examples which you provided would add class to the tr on the expand component table which is inside the tr hidden in the main table(when not in expand state)

thanks

@AllenFang
Copy link
Owner

You means you want to add a class on the expand row(hidden in your snapshot)? if yes, try this and let me know if you have any question or unclear, thanks :)

@supiash1
Copy link

@AllenFang Thanks I have tried that but that adds class only on expand but i want it to add it even when its hidden please

@AllenFang
Copy link
Owner

@supiash1, I'll handle it. Because I force to add class on on expanding, in next version
I will pass isExpand flag to callback function and always the class on expand row. if you dont want to add the class on hidden, just return null or empty string.

@AllenFang
Copy link
Owner

#1409

@supiash1
Copy link

@AllenFang Thank you

@AllenFang
Copy link
Owner

@supiash1, fixed on v3.4.2 and check 0720e60 as example, thanks

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

3 participants