UNPKG

fixed-data-table-one.com

Version:

A React table component designed to allow presenting thousands of rows of data.

72 lines (65 loc) 1.77 kB
/** * Copyright Schrodinger, LLC */ "use strict"; const FakeObjectDataListStore = require('./helpers/FakeObjectDataListStore'); const { TextCell } = require('./helpers/cells'); const { Table, Column, Cell } = require('fixed-data-table-2'); const React = require('react'); class TouchScrollExample extends React.Component { constructor(props) { super(props); this.state = { dataList: new FakeObjectDataListStore(2000) } } render() { let {dataList, collapsedRows} = this.state; return ( <div> <Table rowHeight={50} rowsCount={dataList.getSize()} headerHeight={50} touchScrollEnabled={true} width={1000} height={500} {...this.props}> <Column columnKey="firstName" header={<Cell>First Name</Cell>} cell={<TextCell data={dataList} />} fixed={true} width={100} /> <Column columnKey="lastName" header={<Cell>Last Name</Cell>} cell={<TextCell data={dataList} />} fixed={true} width={100} /> <Column columnKey="city" header={<Cell>City</Cell>} cell={<TextCell data={dataList} />} width={100} /> <Column columnKey="street" header={<Cell>Street</Cell>} cell={<TextCell data={dataList} />} width={200} /> <Column columnKey="zipCode" header={<Cell>Zip Code</Cell>} cell={<TextCell data={dataList} />} width={200} /> </Table> </div> ); } } module.exports = TouchScrollExample;