This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class RegexFilter extends React.Component { | |
| render() { | |
| return ( | |
| <BootstrapTable data={ products }> | |
| <TableHeaderColumn dataField='id' isKey>Product ID</TableHeaderColumn> | |
| <TableHeaderColumn dataField='name' filter={ { type: 'RegexFilter', delay: 1000 } }>Product Name</TableHeaderColumn> | |
| <TableHeaderColumn dataField='price'>Product Price</TableHeaderColumn> | |
| </BootstrapTable> | |
| ); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ProgrammaticallyRegexFilter extends React.Component { | |
| handleBtnClick = () => { | |
| this.refs.nameCol.applyFilter('[name]'); | |
| } | |
| render() { | |
| return ( | |
| <div> | |
| <button onClick={ this.handleBtnClick } className='btn btn-default'>Click to apply Regx filter</button> | |
| <BootstrapTable data={ products }> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const qualityType = { | |
| 0: 'good', | |
| 1: 'Bad', | |
| 2: 'unknown' | |
| }; | |
| function enumFormatter(cell, row, enumObject) { | |
| return enumObject[cell]; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const qualityType = { | |
| 0: 'good', | |
| 1: 'bad', | |
| 2: 'unknown' | |
| }; | |
| function enumFormatter(cell, row, enumObject) { | |
| return enumObject[cell]; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const qualityType = { | |
| 0: 'good', | |
| 1: 'bad', | |
| 2: 'unknown' | |
| }; | |
| function enumFormatter(cell, row, enumObject) { | |
| return enumObject[cell]; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const qualityType = { | |
| 0: 'good', | |
| 1: 'bad', | |
| 2: 'unknown' | |
| }; | |
| function enumFormatter(cell, row, enumObject) { | |
| return enumObject[cell]; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class NumberFilter extends React.Component { | |
| render() { | |
| return ( | |
| <BootstrapTable data={ products }> | |
| <TableHeaderColumn dataField='id' isKey>Product ID</TableHeaderColumn> | |
| <TableHeaderColumn dataField='name'>Product Name</TableHeaderColumn> | |
| <TableHeaderColumn dataField='price' filter={ { | |
| type: 'NumberFilter', | |
| delay: 1000, | |
| numberComparators: [ '=', '>', '<=' ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class NumberFilterWithDefaultValue extends React.Component { | |
| render() { | |
| return ( | |
| <BootstrapTable data={ products }> | |
| <TableHeaderColumn dataField='id' isKey={ true }>Product ID</TableHeaderColumn> | |
| <TableHeaderColumn dataField='name'>Product Name</TableHeaderColumn> | |
| <TableHeaderColumn dataField='price' | |
| filter={ { | |
| type: 'NumberFilter', | |
| delay: 1000, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ProgrammaticallyNumberFilter extends React.Component { | |
| handleBtnClick = () => { | |
| this.refs.nameCol.applyFilter({ | |
| number: 40, | |
| comparator: '>' | |
| }); | |
| } | |
| render() { | |
| return ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const satisfaction = [ 0, 1, 2, 3, 4, 5 ]; | |
| class NumberOptionsFilter extends React.Component { | |
| render() { | |
| return ( | |
| <BootstrapTable data={ products }> | |
| <TableHeaderColumn dataField='id' isKey>Product ID</TableHeaderColumn> | |
| <TableHeaderColumn dataField='name'>Product Name</TableHeaderColumn> | |
| <TableHeaderColumn dataField='satisfaction' filter={ { type: 'NumberFilter', options: satisfaction } }>Buyer Satisfaction</TableHeaderColumn> | |
| </BootstrapTable> |