A higher order component of react-handsontable
react-handsontable-hoc
A higher order component of react-handsontable.
{'id': 41, 'name': 'honda', 'year': 2015, 'volume': 1000, 'processed': true}
]
const columns = [
{data: 'id', type: 'numeric', width: 150, readOnly: true},
{data: 'name', type: 'text', width: 150, readOnly: true},
{data: 'year', type: 'numeric', width: 150, readOnly: true},
{data: 'volume', type: 'numeric', width: 150, readOnly: true},
{data: data => data.processed ? 'Yes' : 'No', type: 'text', width: 150, readOnly: true}
]
const colHeaders = ['ID', 'NAME', 'YEAR', 'VOLUME', 'PROCESSED?']
// VOLUME is hidden
const hiddenColumns = [3]
// sort by NAME
const columnSorting = {
column: 4,
sortOrder: 'desc'
}
// filter by NAME
const filter = new RowFilter([
{
physical: 1,
expression: Expressions.get({
symbol: 'by_values',
props: ['ford', 'volvo']
})
}
])
return (
<HotTableContainer
width="800" height="300"
data={data} columns={columns} colHeaders={colHeaders}
hiddenColumns={hiddenColumns}
columnSorting={columnSorting}
manualColumnMove={true}
manualColumnResize={true}
rowFilter={filter}/>
)
}
## How to build
```bash
$ npm install
$ npm run build