-
Notifications
You must be signed in to change notification settings - Fork 776
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
Expand component rendered at table construction? #1299
Comments
did you means you want to render the expanding content when the row is expanded? and destroy is when it collapse? |
@AllenFang Hi Allen but this brings another small issue, when click the row again to collapse, the API is triggered again. I don't see any information in the documentation that I can get indicators from any event to tell if a row is expanded or collapsed. for example, properties like row.expanded. This could be a good enhancement if currently not supported. Thanks, Richard. |
I think use |
That would be great Allen! Thanks a lot ! Regards, Richard. |
hello @RichardYang2016, check this, I support the |
Thank you so much Allen! |
I am getting a similar issue with the expand causing the expandComponent to be accessed for every row regardless of whether the user clicked expand or now. How is the onExpand implemented? Here is my code - https://github.com/zillerium/zmes/tree/master/zmes/src |
Hey fork, I've no time to check your repo, it too big to me, give me the point or check this example, thanks |
Fork the entire repo for asking a question? |
obviously he actually meant 'folk'... don't be panic. anyway I do recommend you looking at the example provided. put a event handler for onExpand in place and put a debug point to look at the event itself you should be able to figure out how to use it. It does solve my problem earlier. pretty neat. |
@zillerium @RichardYang2016 this.state = { handleExpand(rowKey, isExpand, e) {
} expandComponent(row) { const options = { <BootstrapTable ...... expandComponent={this.expandComponent} > |
Rendering every expanded column at table construction and not rendering the expansion when the row is expanded is incredibly unintuitive and will cause serious load-time issues for me as well. Is there still no workaround, implementation, or fix? |
Hi there,
So the scenario is, in my redux store I have a node for data of current expanded row, and all rows are expandable.
In debug I find that, such component are constructed for each and every row of the table, even if the row is not expanded. Plus, my redux node of current opened row are rendered to all components for the rows. Only difference is the components are hidden except the current selected row.
Is there a way to not render all those expand components at the construction of the table itself, but rather render it and destruct it every time I expand/collapse a row?
Thanks, Richard.
The text was updated successfully, but these errors were encountered: