Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React, { Component } from 'react'
- import { AgGridReact } from 'ag-grid-react'
- import 'ag-grid-community/dist/styles/ag-grid.css'
- import 'ag-grid-community/dist/styles/ag-theme-balham.css'
- const defaultColDef = {
- editable: true,
- resizable: true
- }
- class TableContent extends Component {
- constructor (props) {
- super(props)
- this.state = {
- columnDefs: [{
- headerName: 'Make', field: 'make', width: 100
- }, {
- headerName: 'Model', field: 'model', width: 100
- }, {
- headerName: 'Price', field: 'price', width: 100
- }],
- rowData: [{
- make: 'Toyota', model: 'Celica', price: 35000
- }, {
- make: 'Ford', model: 'Mondeo', price: 32000
- }, {
- make: 'Porsche', model: 'Boxter', price: 72000
- }]
- }
- }
- render () {
- return (
- <div
- className='ag-theme-balham'
- style={{
- minHeight: '180px',
- width: '600px' }}
- >
- <AgGridReact
- defaultColDef={defaultColDef}
- columnDefs={this.state.columnDefs}
- rowData={this.state.rowData} />
- </div>
- )
- }
- }
- export default TableContent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement