Data Table
import * as React from "react";
import { withNamespaces } from 'react-i18next';
import {BootstrapTable, TableHeaderColumn} from 'react-bootstrap-table';
var products = [{
.....
}, {
.....
}];
class SortTable extends React.Component {
constructor(props) {
super(props);
this.options = {
defaultSortName: 'name',
defaultSortOrder: 'desc'
};
}
render() {
return (
<BootstrapTable data={ products } options={ this.options }>
<TableHeaderColumn dataField='id' isKey dataSort>....../TableHeaderColumn>
</BootstrapTable>
);
}
}
export default withNamespaces()(SortTable);