我正在使用react bootstrap table lib,我遵循了所有文档说明,但是我想要创建一个多法定货币选项以将productprice列从美元更改为另一法定货币,我可以从后端发送数据。但我不知道如何在react bootstrap table lib(http://allenfang.github.io/react-bootstrap-table/)
中正确实现此选项这是示例代码:
let order = 'desc';
class SortTable extends React.Component {
handleBtnClick = () => {
if (order === 'desc') {
this.refs.table.handleSort('asc', 'name');
order = 'asc';
} else {
this.refs.table.handleSort('desc', 'name');
order = 'desc';
}
}
render() {
return (
<div>
<p style={ { color: 'red' } }>You cam click header to sort or click following button to perform a sorting by expose API</p>
<button onClick={ this.handleBtnClick }>Sort Product Name</button>
<BootstrapTable ref='table' data={ products }>
<TableHeaderColumn dataField='id' isKey={ true } dataSort={ true }>Product ID</TableHeaderColumn>
<TableHeaderColumn dataField='name' dataSort={ true }>Product Name</TableHeaderColumn>
<TableHeaderColumn dataField='price'>Product Price</TableHeaderColumn>
</BootstrapTable>
</div>
);
}
}