Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. import React, { Component } from 'react'
  2. import { AgGridReact } from 'ag-grid-react'
  3. import 'ag-grid-community/dist/styles/ag-grid.css'
  4. import 'ag-grid-community/dist/styles/ag-theme-balham.css'
  5.  
  6. const defaultColDef = {
  7. editable: true,
  8. resizable: true
  9. }
  10. class TableContent extends Component {
  11. constructor (props) {
  12. super(props)
  13. this.state = {
  14. columnDefs: [{
  15. headerName: 'Make', field: 'make', width: 100
  16. }, {
  17. headerName: 'Model', field: 'model', width: 100
  18. }, {
  19. headerName: 'Price', field: 'price', width: 100
  20. }],
  21. rowData: [{
  22. make: 'Toyota', model: 'Celica', price: 35000
  23. }, {
  24. make: 'Ford', model: 'Mondeo', price: 32000
  25. }, {
  26. make: 'Porsche', model: 'Boxter', price: 72000
  27. }]
  28. }
  29. }
  30.  
  31. render () {
  32. return (
  33. <div
  34. className='ag-theme-balham'
  35. style={{
  36. minHeight: '180px',
  37. width: '600px' }}
  38. >
  39. <AgGridReact
  40. defaultColDef={defaultColDef}
  41. columnDefs={this.state.columnDefs}
  42. rowData={this.state.rowData} />
  43. </div>
  44. )
  45. }
  46. }
  47.  
  48. export default TableContent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement