Skip to content
This repository was archived by the owner on Aug 19, 2024. It is now read-only.

Commit f035ee7

Browse files
committed
v14 changes
1 parent a982e0f commit f035ee7

4 files changed

Lines changed: 22 additions & 21 deletions

File tree

src-large/largeGrid.jsx

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
import React from 'react';
2-
import {reactCellRendererFactory} from 'ag-grid-react';
1+
import React, {Component} from 'react';
32
import SimpleCellRenderer from './simpleCellRenderer.jsx';
43

54
import {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
}

src/NavItem.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import React, {PropTypes} from 'react'
1+
import React from 'react'
2+
import * as PropTypes from 'prop-types';
23
import {Route, Link} from 'react-router-dom'
34

45
// for bootstrap li active functionality

src/editorComponentExample/NumericEditor.jsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@ export default class MoodEditor extends Component {
3232
}
3333

3434
focus() {
35-
setTimeout(() => {
36-
this.refs.input.focus();
37-
this.refs.input.setSelectionRange(this.state.value.length, this.state.value.length);
38-
39-
})
35+
if (!this.cancelBeforeStart) {
36+
setTimeout(() => {
37+
this.refs.input.focus();
38+
this.refs.input.setSelectionRange(this.state.value.length, this.state.value.length);
39+
})
40+
}
4041
}
4142

4243
getValue() {

src/filterComponentExample/PartialMatchFilter.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default class PartialMatchFilter extends Component {
3434
this.state.text = model ? model.value : '';
3535
}
3636

37-
afterGuiAttached(params) {
37+
componentDidMount() {
3838
this.focus();
3939
}
4040

0 commit comments

Comments
 (0)