Skip to content

Instantly share code, notes, and snippets.

@AllenFang
Created November 15, 2016 13:04
Show Gist options
  • Select an option

  • Save AllenFang/53bfe8746e1face5ca7fc0e82d68c399 to your computer and use it in GitHub Desktop.

Select an option

Save AllenFang/53bfe8746e1face5ca7fc0e82d68c399 to your computer and use it in GitHub Desktop.
class CustomButtonGroup extends React.Component {
createCustomButtonGroup = props => {
return (
<ButtonGroup className='my-custom-class' sizeClass='btn-group-md'>
{ props.showSelectedOnlyBtn }
{ props.exportCSVBtn }
{ props.insertBtn }
{ props.deleteBtn }
<button type='button'
className={ `btn btn-primary` }>
MyCustomBtn
</button>
</ButtonGroup>
);
}
render() {
const selectRow = {
mode: 'checkbox'
};
const options = {
btnGroup: this.createCustomButtonGroup
};
return (
<BootstrapTable data={ products }
options={ options }
selectRow={ selectRow }
insertRow
deleteRow
exportCSV>
<TableHeaderColumn dataField='id' isKey={ true }>Product ID</TableHeaderColumn>
<TableHeaderColumn dataField='name'>Product Name</TableHeaderColumn>
<TableHeaderColumn dataField='price'>Product Price</TableHeaderColumn>
</BootstrapTable>
);
}
}
@jh3ady

jh3ady commented Dec 19, 2016

Copy link
Copy Markdown

https://gist.github.com/AllenFang/53bfe8746e1face5ca7fc0e82d68c399#file-custom-button-group-jsx-L23

Hi AllenFang, this option 'btnGroup' is deprecated ? Because we can see this example on : http://allenfang.github.io/react-bootstrap-table/example.html#custom
But in the documentation (http://allenfang.github.io/react-bootstrap-table/docs.html) we cannot find this option and this example does not works for me !

@tayzee

tayzee commented Apr 29, 2017

Copy link
Copy Markdown

@jean, did you figure out how to get around this problem?

I need to make use of some custom buttons

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment