react-table-grid
v1.2.7
Published
external library
Downloads
6
Readme
react-table-grid
external library
Install
npm install --save react-table-grid
Usage
import React, { Component } from 'react'
import TableGrid from 'react-table-grid'
const mockData = [
{ data: { foo: 'bar' } },
];
class Example extends Component {
render () {
return (
<TableGrid
data={mockData}
renderColumns={{
index: {
value: (value, idx, row) => { return idx + 1 },
name: '#',
},
foo: {
value: null, //if it's null then value from data will be taken
name: 'Value',
},
}}
renderChildTitle={false}
renderChildHeaders={false}
paginateBy={15}
/>
)
}
}
Props
Common props you may want to specify include:
data
- data ArrayclassName
- apply a className to the controlrenderColumns
- an object with render methods for every column; columns will be rendered according to order of keysrenderChildTitle
- to render a title for child tablesrenderChildHeaders
- to render column headers for child tablescollapseRow
- subscribe to collapse events
** pagination props according to https://github.com/AdeleD/react-paginate#readme
License
MIT © Mikhe