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

How to show select column BUT hide selectAll #230

Closed
vgoklani opened this issue Jan 22, 2016 · 15 comments
Closed

How to show select column BUT hide selectAll #230

vgoklani opened this issue Jan 22, 2016 · 15 comments

Comments

@vgoklani
Copy link

Hi, is there a way to show the select column (with the checkboxes) but hide the selectAll button at the top?

Thanks!

@AllenFang
Copy link
Owner

@vgoklani, there's no way to do it. but I can add a class on selectAll checkbox for you to hide, how about that?
Thanks:)

@vgoklani
Copy link
Author

that should be perfect, thank you so much!

@eric379990
Copy link

@AllenFang Hi Allen, also a question for the row edit, if enable the deleteRow={true}, is it possible to call my custom function when the delete button is clicked?

@AllenFang
Copy link
Owner

@eric379990, what's means for your custom function? you want a row deletion hook?

@eric379990
Copy link

@AllenFang I have 2 tables, user can select some items in the first table and add to the 2nd table, and also can delete some items in the 2nd table, the items needs to back to the 1st table. so I want to handle the item back actions in the onDelete function.

@AllenFang
Copy link
Owner

function afterRowDelete(rowKeys) {
    // rowKeys is the rowkeys which you delete
}

var options = {
    afterDeleteRow: afterDeleteRow
}
//....
ReactDOM.render(
 <BootstrapTable data={products} options={options}>
.....
);

@eric379990
Copy link

Thanks Allen, this helped a lot!

@AllenFang
Copy link
Owner

@vgoklani, I've add the class react-bs-select-all on select all checkbox. please check this out
Thanks :)

@vgoklani
Copy link
Author

Thanks @AllenFang for adding the react-bs-select-all class. Quick question - is there a way to dynamically set the "display: none" via React? I would prefer not to touch the .css/.less files if possible

@AllenFang
Copy link
Owner

@vgoklani, sure, just give it a style

@vgoklani
Copy link
Author

not following, how would I pass in the style to set display:none for the react-bs-select-all class from React? Thanks!

@AllenFang
Copy link
Owner

@vgoklani, I got the wrong consideration. sorry for that. In this situation, the only way is modify the css file

@vgoklani
Copy link
Author

ok, thanks!

@yasaiki
Copy link

yasaiki commented May 22, 2020

I am having a difficult time hiding all select with react-bs-select-all class. Anyone can help me on how to accomplish that in css? The selector is not picking up the css.

@chiragmansata
Copy link

Firstly a big shout out to the owners and maintainers of this library, it is indeed a great one.
Secondly to answer @vgoklani : I too am having the same use case for conditional show hide of select all and below code works for me:
if (typeof (document.getElementsByClassName("react-bs-select-all")) !== 'undefined' && document.getElementsByClassName("react-bs-select-all").length > 0) {
document.getElementsByClassName("react-bs-select-all")[0].setAttribute('style', display:none);
}
You can place it in your componentDidUpdate() method and based on the condition modify the display value to show ('') or Hide ('none')

@yasaiki : Below code shall work, just place it in your css (in case still not working then can try the above way aswell)
.react-bs-select-all{
display: none;
}

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

5 participants