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
| satisfaction = [ 0, 1, 2, 3, 4, 5 ]; | |
| class NumberOptionsFilterWithDefaultValue 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, defaultValue: { number: 3, comparator: '>=' } } }>Buyer Satisfaction</TableHeaderColumn> |
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 startDate = new Date(2015, 0, 1); | |
| // const endDate = new Date(); | |
| // new Date(startDate.getTime() + Math.random() * (endDate.getTime() - startDate.getTime())); | |
| function dateFormatter(cell, row) { | |
| return `${('0' + cell.getDate()).slice(-2)}/${('0' + (cell.getMonth() + 1)).slice(-2)}/${cell.getFullYear()}`; | |
| } | |
| class DateFilter extends React.Component { | |
| render() { |
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 startDate = new Date(2015, 0, 1); | |
| // const endDate = new Date(); | |
| // new Date(startDate.getTime() + Math.random() * (endDate.getTime() - startDate.getTime())); | |
| function dateFormatter(cell, row) { | |
| return `${('0' + cell.getDate()).slice(-2)}/${('0' + (cell.getMonth() + 1)).slice(-2)}/${cell.getFullYear()}`; | |
| } | |
| class DateFilter extends React.Component { | |
| render() { |
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 startDate = new Date(2015, 0, 1); | |
| // const endDate = new Date(); | |
| // new Date(startDate.getTime() + Math.random() * (endDate.getTime() - startDate.getTime())); | |
| function dateFormatter(cell, row) { | |
| return `${('0' + cell.getDate()).slice(-2)}/${('0' + (cell.getMonth() + 1)).slice(-2)}/${cell.getFullYear()}`; | |
| } | |
| class ProgrammaticallyDateFilter extends React.Component { | |
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 CheckboxFilter extends React.Component { | |
| constructor(props) { | |
| super(props); | |
| this.filter = this.filter.bind(this); | |
| this.isFiltered = this.isFiltered.bind(this); | |
| } | |
| filter(event) { | |
| if (this.refs.nokCheckbox.checked && this.refs.okCheckbox.checked) { |
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
| function formatFloat(cell, row) { | |
| return parseFloat(cell); | |
| } | |
| class FloatFilter extends React.Component { | |
| render() { | |
| return ( | |
| <BootstrapTable data={ products }> | |
| <TableHeaderColumn dataField='id' isKey>Product ID</TableHeaderColumn> |
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 selectRowProp = { | |
| mode: 'radio' | |
| }; | |
| class SingleSelectTable extends React.Component { | |
| render() { | |
| return ( | |
| <BootstrapTable data={ products } selectRow={ selectRowProp }> | |
| <TableHeaderColumn dataField='id'>Product ID</TableHeaderColumn> | |
| <TableHeaderColumn dataField='name'>Product Name</TableHeaderColumn> |
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 selectRowProp = { | |
| mode: 'checkbox' | |
| }; | |
| class MultiSelectTable extends React.Component { | |
| render() { | |
| return ( | |
| <BootstrapTable data={ products } selectRow={ selectRowProp }> | |
| <TableHeaderColumn dataField='id' isKey>Product ID</TableHeaderColumn> | |
| <TableHeaderColumn dataField='name'>Product Name</TableHeaderColumn> |
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 selectRowProp = { | |
| mode: 'checkbox', | |
| clickToSelect: true, | |
| unselectable: [ 1, 3 ] // give rowkeys for unselectable row | |
| }; | |
| class UnSelectableTable extends React.Component { | |
| render() { | |
| return ( | |
| <BootstrapTable data={ products } selectRow={ selectRowProp }> |