Skip to content

Commit

Permalink
iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
ceolter committed Jan 22, 2016
1 parent d3f7a66 commit 71aed21
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 7 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
"webpack": "1.12.11",
"react": "0.14.6",
"react-dom": "0.14.6",
"css-loader": "0.23.1",
"style-loader": "0.13.0",
"babel-loader": "6.2.1",
"babel-preset-react": "6.3.13",
"babel-preset-es2015": "6.3.13"
Expand Down
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import ReactDOM from 'react-dom';
import React from 'react';
import {MyApp} from './myApp.jsx';
import 'ag-grid-root/ag-grid.css';
import 'ag-grid-root/theme-fresh.css';

document.addEventListener('DOMContentLoaded', ()=> {
var container = document.getElementById('myAppContainer');
Expand Down
29 changes: 29 additions & 0 deletions src/myApp.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

.ag-cell {
padding-top: 2px !important;
padding-bottom: 2px !important;
}

label {
font-weight: normal !important;
}

.div-percent-bar {
display: inline-block;
height: 100%;
position: relative;
}

.div-percent-value {
position: absolute;
z-index: 1;
padding-left: 4px;
font-weight: bold;
font-size: 13px;
}

.div-outer-div {
display: inline-block;
height: 100%;
width: 100%;
}
13 changes: 7 additions & 6 deletions src/myApp.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import ReactDOM from 'react-dom';
import React from 'react';
import AgGrid from 'ag-grid';
import './myApp.css';

var firstNames = ["Sophie", "Isabelle", "Emily", "Olivia", "Lily", "Chloe", "Isabella",
"Amelia", "Jessica", "Sophia", "Ava", "Charlotte", "Mia", "Lucy", "Grace", "Ruby",
Expand Down Expand Up @@ -136,7 +137,7 @@ export class MyApp extends React.Component {
</div>
<div style={{clear: 'both'}}/>
</div>
<MyGrid mouse="white" style={{width: '100%', height: '400px'}}></MyGrid>
<MyGrid style={{width: '100%', height: '400px'}} className="ag-fresh"></MyGrid>
</div>;
}
}
Expand Down Expand Up @@ -169,7 +170,7 @@ class MyGrid extends React.Component {
}

render() {
return <div style={this.props.style} />;
return <div style={this.props.style} className={this.props.className} />;
}

createRowData() {
Expand Down Expand Up @@ -237,8 +238,7 @@ class MyGrid extends React.Component {

MyGrid.propTypes = {
'style': React.PropTypes.object,
'class': React.PropTypes.string,
mouse: React.PropTypes.string
'className': React.PropTypes.string
};

var btBringGridBack;
Expand Down Expand Up @@ -337,12 +337,12 @@ MyGrid.propTypes = {
}

var SKILL_TEMPLATE =
'<label style="border: 1px solid lightgrey; margin: 4px; padding: 4px;">' +
'<label style="border: 1px solid lightgrey; margin: 4px; padding: 4px; display: inline-block;">' +
' <span>' +
' <div style="text-align: center;">SKILL_NAME</div>' +
' <div>' +
' <input type="checkbox"/>' +
' <img src="/images/skills/SKILL.png" width="30px"/>' +
' <img src="images/skills/SKILL.png" width="30px"/>' +
' </div>' +
' </span>' +
'</label>';
Expand All @@ -368,6 +368,7 @@ MyGrid.propTypes = {

SkillFilter.prototype.getGui = function () {
var eGui = document.createElement('div');
eGui.style.width = '380px';
var eInstructions = document.createElement('div');
eInstructions.innerHTML = FILTER_TITLE.replace('TITLE_NAME', 'Custom Skills Filter');
eGui.appendChild(eInstructions);
Expand Down
5 changes: 4 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ module.exports = {
]
},
resolve: {
alias: {"ag-grid" : __dirname + "/node_modules/ag-grid/dist/ag-grid.js"}
alias: {
"ag-grid" : __dirname + "/node_modules/ag-grid/dist/ag-grid.js",
"ag-grid-root" : __dirname + "/node_modules/ag-grid/dist"
}
}
};

0 comments on commit 71aed21

Please sign in to comment.