@@ -97,10 +97,15 @@ class BootstrapTable extends Component {
97
97
const { options, pagination } = this . props ;
98
98
const sortName = options . defaultSortName || options . sortName ;
99
99
const sortOrder = options . defaultSortOrder || options . sortOrder ;
100
+ const searchText = options . defaultSearch ;
100
101
if ( sortName && sortOrder ) {
101
102
this . store . sort ( sortOrder , sortName ) ;
102
103
}
103
104
105
+ if ( searchText ) {
106
+ this . store . search ( searchText ) ;
107
+ }
108
+
104
109
if ( pagination ) {
105
110
let page ;
106
111
let sizePerPage ;
@@ -788,6 +793,7 @@ class BootstrapTable extends Component {
788
793
return (
789
794
< div className = 'react-bs-table-tool-bar' >
790
795
< ToolBar
796
+ defaultSearch = { this . props . options . defaultSearch }
791
797
clearSearch = { this . props . options . clearSearch }
792
798
searchDelayTime = { this . props . options . searchDelayTime }
793
799
enableInsert = { insertRow }
@@ -983,7 +989,8 @@ BootstrapTable.propTypes = {
983
989
deleteText : PropTypes . string ,
984
990
saveText : PropTypes . string ,
985
991
closeText : PropTypes . string ,
986
- ignoreEditable : PropTypes . bool
992
+ ignoreEditable : PropTypes . bool ,
993
+ defaultSearch : PropTypes . string
987
994
} ) ,
988
995
fetchInfo : PropTypes . shape ( {
989
996
dataTotalSize : PropTypes . number
@@ -1068,7 +1075,8 @@ BootstrapTable.defaultProps = {
1068
1075
deleteText : Const . DELETE_BTN_TEXT ,
1069
1076
saveText : Const . SAVE_BTN_TEXT ,
1070
1077
closeText : Const . CLOSE_BTN_TEXT ,
1071
- ignoreEditable : false
1078
+ ignoreEditable : false ,
1079
+ defaultSearch : ''
1072
1080
} ,
1073
1081
fetchInfo : {
1074
1082
dataTotalSize : 0
0 commit comments