@@ -746,7 +746,8 @@ class BootstrapTable extends Component {
746
746
|| insertRow
747
747
|| deleteRow
748
748
|| search
749
- || this . props . exportCSV ) {
749
+ || this . props . exportCSV
750
+ || this . props . customButtons . length > 0 ) {
750
751
let columns ;
751
752
if ( Array . isArray ( children ) ) {
752
753
columns = children . map ( function ( column ) {
@@ -794,7 +795,9 @@ class BootstrapTable extends Component {
794
795
onDropRow = { this . handleDropRow }
795
796
onSearch = { this . handleSearch }
796
797
onExportCSV = { this . handleExportCSV }
797
- onShowOnlySelected = { this . handleShowOnlySelected } />
798
+ onShowOnlySelected = { this . handleShowOnlySelected }
799
+ customButtons = { this . props . customButtons } />
800
+
798
801
</ div >
799
802
) ;
800
803
} else {
@@ -977,7 +980,13 @@ BootstrapTable.propTypes = {
977
980
} ) ,
978
981
exportCSV : PropTypes . bool ,
979
982
csvFileName : PropTypes . string ,
980
- ignoreSinglePage : PropTypes . bool
983
+ ignoreSinglePage : PropTypes . bool ,
984
+ customButtons : React . PropTypes . arrayOf ( React . PropTypes . shape ( {
985
+ text : React . PropTypes . string . isRequired ,
986
+ icon : React . PropTypes . string ,
987
+ bsStyle : React . PropTypes . string ,
988
+ handler : React . PropTypes . func . isRequired
989
+ } ) )
981
990
} ;
982
991
BootstrapTable . defaultProps = {
983
992
height : '100%' ,
@@ -1062,7 +1071,8 @@ BootstrapTable.defaultProps = {
1062
1071
} ,
1063
1072
exportCSV : false ,
1064
1073
csvFileName : 'spreadsheet.csv' ,
1065
- ignoreSinglePage : false
1074
+ ignoreSinglePage : false ,
1075
+ customButtons : [ ]
1066
1076
} ;
1067
1077
1068
1078
export default BootstrapTable ;
0 commit comments