AG-420 Improve React implementation

This commit is contained in:
Sean Landsman
2017-05-25 12:21:02 +01:00
parent 4ef1959a52
commit 587af2e888
5 changed files with 28 additions and 24 deletions

View File

@@ -8,6 +8,7 @@
"standard": "webpack-dev-server --config webpack.config.standard.js --progress --colors --hot --inline",
"grouped": "webpack-dev-server --config webpack.config.grouped.js --progress --colors --hot --inline",
"trader": "webpack-dev-server --content-base src-trader-dashboard/ --config webpack.config.trader.js --progress --colors --hot --inline",
"examples": "webpack-dev-server --content-base src/ --config webpack.config.examples.js --progress --colors --hot --inline",
"large": "webpack-dev-server --config webpack.config.large.js --progress --colors --hot --inline",
"clean": "rimraf dist",
"build-standard": "npm run clean && webpack --config webpack.config.standard.js --progress --profile --bail"
@@ -29,27 +30,30 @@
},
"homepage": "http://www.ag-grid.com/",
"devDependencies": {
"babel-core": "6.0.0",
"babel-loader": "6.2.1",
"babel-preset-es2015": "6.3.13",
"babel-preset-react": "6.3.13",
"babel-preset-stage-0": "^6.24.1",
"babel-preset-stage-1": "6.24.1",
"css-loader": "0.23.1",
"style-loader": "0.13.0",
"webpack": "1.12.11",
"webpack-dev-server": "1.14.1"
"babel-core": "6.24.x",
"babel-loader": "6.4.x",
"babel-preset-es2015": "6.24.x",
"babel-preset-react": "6.24.x",
"babel-preset-stage-0": "6.24.x",
"babel-preset-stage-1": "6.24.x",
"css-loader": "0.23.x",
"style-loader": "0.13.x",
"webpack": "1.12.x",
"webpack-dev-server": "1.14.x"
},
"dependencies": {
"ag-grid": "10.0.x",
"ag-grid-enterprise": "10.0.x",
"ag-grid-react": "10.0.x",
"bootstrap": "^3.3.7",
"d3": "4.9.1",
"file-loader": "^0.11.1",
"lodash": "4.17.4",
"react": "15.5.x",
"react-dom": "15.5.x",
"react-redux": "5.0.5",
"redux": "3.6.0",
"rimraf": "2.5.x",
"ag-grid": "10.0.x",
"ag-grid-enterprise": "10.0.x",
"ag-grid-react": "10.0.x"
"react-redux": "5.0.x",
"react-router-dom": "4.1.x",
"redux": "3.6.x",
"rimraf": "2.5.x"
}
}

View File

@@ -21,10 +21,10 @@ class FxQuoteMatrix extends Component {
onGridReady(params) {
this.gridApi = params.api;
this.columnApi = params.columnApi;
}
componentDidMount() {
this.gridApi.setRowData(this.props.rowData);
if (this.props.rowData) {
this.gridApi.setRowData(this.props.rowData)
}
}
componentWillReceiveProps(nextProps) {

View File

@@ -44,10 +44,10 @@ class TopMoversGrid extends Component {
onGridReady(params) {
this.gridApi = params.api;
this.columnApi = params.columnApi;
}
componentDidMount() {
this.gridApi.setRowData(this.props.rowData);
if (this.props.rowData) {
this.gridApi.setRowData(this.props.rowData);
}
this.gridApi.sizeColumnsToFit();
}

View File

@@ -7,7 +7,6 @@ import {Provider} from "react-redux";
import "ag-grid-root/dist/styles/ag-grid.css";
import "ag-grid-root/dist/styles/theme-fresh.css";
// import "ag-grid-root/dist/styles/theme-blue.css";
import StoreService from './services/StoreService';
import TraderDashboard from "./components/TraderDashboard.jsx";

View File

@@ -27,6 +27,7 @@ module.exports = {
resolve: {
alias: {
"ag-grid-root" : __dirname + "/node_modules/ag-grid"
}
},
extensions: ['', '.js', '.jsx']
}
};