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

Checkbox checked property still remainig even if I reassgined data #244

Closed
Dhaval8087 opened this issue Jan 28, 2016 · 5 comments
Closed

Comments

@Dhaval8087
Copy link

I have two tab and in both tab I have used the react-bootstrap-table so on very first tab I have selected 2 record usig check box and going to second tab and select one record and came back to first tab it will show 2 record selected even if I have reassigned data when tab is clicked how can I set all deselect when change tab and coming back

@AllenFang
Copy link
Owner

@Dhaval8087, do you want the table clean all selection states when switching tab?

@Dhaval8087
Copy link
Author

Yes it should not maintain the state when I switch to other tab currently it maintain the state

@AllenFang
Copy link
Owner

The selection state should be maintain inside even if you reload the data. Because I never know the state outside of this component. So, there are some solution for you:

  1. when you change tab, you can set the default selected as empty for cleaning table selection.
  2. I can provide a expose API function for user to clean the selection state as their desired

I thinks the second one is a better solution, if you confirm this, I can add it in next version
Thanks

@Dhaval8087
Copy link
Author

Yes, Please it would be really great help if you can update in react-bootstrap-table API so user can clean the select state wherever he wants :) its really appreciate your quick response I am waiting for next version
Thanks

@AllenFang
Copy link
Owner

// clean all selection as following
this.refs.table.cleanSelected()

//...
<BootstrapTable ref='table' ...>
...
</BootstrapTable>

Supported on v1.4.6

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