-
Notifications
You must be signed in to change notification settings - Fork 775
Added code for custom buttons #528
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
Conversation
I should have added a code example ... const customButtons = [
{
text: 'Display an alert',
handler: () => alert('Custom button Clicked')
},
{
text: 'Do not click here !',
handler: () => alert('You, bad boy !'),
bsStyle: 'warning',
icon: 'alert'
}
];
return (
<BootstrapTable
data={ products }
customButtons={ customButtons }>
<TableHeaderColumn dataField='id' isKey={ true }>Product ID</TableHeaderColumn>
<TableHeaderColumn dataField='name'>Product Name</TableHeaderColumn>
<TableHeaderColumn dataField='price'>Product Price</TableHeaderColumn>
</BootstrapTable>
); |
@mbaroukh, that's awesome, it's a good improvement. But you know, there're a lot of issues which hope they can add not only button but also select, field,, etc. So I've planned to start work for Anyway, Thanks your contribution 💯 You did a great job :) |
Hi @mbaroukh , I tried to use your code with latest master branch, and it doesn't work for me. any idea please? |
Hi @mbaroukh , Yes, I did exactly you described on your code, but somehow the custom button did not show up on my page. I have no idea why. Thanks, |
Hi @mbaroukh, /CC: @AllenFang |
@zRaspina, check #497 (comment), you can check the examples for how to custom the buttons. The |
@AllenFang, I can't find related example about custom buttons. Can you post link here man? 😉 |
https://github.com/AllenFang/react-bootstrap-table/tree/v3.0.0-dev/examples/js/custom
I've no idea, maybe on February or March(After chinese new year) |
Hi,
I just added the ability to put custom buttons in the toolbar.
You can see it in action here :
https://www.baroukh.com/nb/react-bootstrap-table-doc/#/examples/custom
I needed it for a project and it is enough for me but if this pull request is ok for you, I'll take time to link (if asked) those buttons to currently selected lines so the action can occur on specific rows.
Thanks for this library !
Mike