1- import React from 'react' ;
2- import { reactCellRendererFactory } from 'ag-grid-react' ;
1+ import React , { Component } from 'react' ;
32import SimpleCellRenderer from './simpleCellRenderer.jsx' ;
43
54import { AgGridReact } from 'ag-grid-react' ;
65
76// put this line in to use ag-Grid enterprise
87// import 'ag-grid-enterprise';
98
10- export default class MyApp extends React . Component {
9+ export default class MyApp extends Component {
1110
1211 constructor ( ) {
1312 super ( ) ;
@@ -22,22 +21,22 @@ export default class MyApp extends React.Component {
2221
2322 createColumnNames ( ) {
2423 // creates column names by iterating the alphabet twice, eg {'aa','ab','ac',.....'zz'}
25- var alphabet = 'abcdefghijklmnopqrstuvwxyz' . split ( '' ) ;
24+ const alphabet = 'abcdefghijklmnopqrstuvwxyz' . split ( '' ) ;
2625 this . columnNames = [ ] ;
27- alphabet . forEach ( letter1 => {
28- alphabet . forEach ( letter2 => {
26+ alphabet . forEach ( letter1 => {
27+ alphabet . forEach ( letter2 => {
2928 this . columnNames . push ( letter1 + letter2 ) ;
3029 } ) ;
3130 } ) ;
3231 }
3332
3433 createRowData ( ) {
35- var rowData = [ ] ;
34+ const rowData = [ ] ;
3635
37- for ( var i = 0 ; i < 1000 ; i ++ ) {
38- var item = { } ;
39- this . columnNames . forEach ( colName => {
40- item [ colName ] = '(' + colName . toUpperCase ( ) + ',' + i + ')'
36+ for ( let i = 0 ; i < 1000 ; i ++ ) {
37+ const item = { } ;
38+ this . columnNames . forEach ( colName => {
39+ item [ colName ] = '(' + colName . toUpperCase ( ) + ',' + i + ')'
4140 } ) ;
4241 rowData . push ( item ) ;
4342 }
@@ -46,9 +45,9 @@ export default class MyApp extends React.Component {
4645 }
4746
4847 createColumnDefs ( ) {
49- var columnDefs = [ ] ;
48+ const columnDefs = [ ] ;
5049
51- this . columnNames . forEach ( colName => {
50+ this . columnNames . forEach ( colName => {
5251 columnDefs . push ( {
5352 headerName : colName . toUpperCase ( ) ,
5453 field : colName ,
@@ -63,7 +62,7 @@ export default class MyApp extends React.Component {
6362 render ( ) {
6463 return (
6564 < div style = { { height : '100%' } } className = "ag-fresh" >
66- < AgGridReact columnDefs = { this . state . columnDefs } rowData = { this . state . rowData } />
65+ < AgGridReact columnDefs = { this . state . columnDefs } rowData = { this . state . rowData } />
6766 </ div >
6867 ) ;
6968 }
0 commit comments