File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ export default class ExternalMultiSort extends React.Component {
3535 sortOrder : [ ]
3636 } ;
3737 this . onSortChange = this . onSortChange . bind ( this ) ;
38+ this . cleanSort = this . cleanSort . bind ( this ) ;
3839 }
3940
4041 onSortChange ( name , order ) {
@@ -56,6 +57,13 @@ export default class ExternalMultiSort extends React.Component {
5657 } ) ;
5758 }
5859
60+ cleanSort ( ) {
61+ this . setState ( {
62+ sortName : [ ] ,
63+ sortOrder : [ ]
64+ } ) ;
65+ }
66+
5967 render ( ) {
6068 const options = {
6169 // reassign the multi sort list by an Array
@@ -66,6 +74,7 @@ export default class ExternalMultiSort extends React.Component {
6674 } ;
6775 return (
6876 < div >
77+ < button className = 'btn ben-default' onClick = { this . cleanSort } > Clean</ button >
6978 < p style = { { color : 'red' } } > sort: sortName={ this . state . sortName } , sortOrder={ this . state . sortOrder } </ p >
7079 < BootstrapTable data = { products } options = { options } multiColumnSort = { 2 } >
7180 < TableHeaderColumn dataField = 'id' isKey = { true } dataSort = { true } > Product ID</ TableHeaderColumn >
You can’t perform that action at this time.
0 commit comments