implement reactjs history

This commit is contained in:
Eric Hulburd
2016-03-04 13:59:34 -06:00
parent 5b218f6518
commit aa885f331c
27 changed files with 549 additions and 546 deletions

View File

@@ -5,14 +5,18 @@ import House from './../../../models/house';
class TableComponent extends React.Component {
get state_manager(){
return this.props.state_manager;
}
get house(){
return this.state_manager.state.house;
}
render() {
var powerTableRt = Templates.forComponent('power_table');
return powerTableRt.call(this);
}
}
TableComponent.contextTypes = {
router: React.PropTypes.object.isRequired
};
export default TableComponent;
module.exports = TableComponent;

View File

@@ -1,4 +1,4 @@
<table id="power_table" class="table" rt-if="this.context.house">
<table id="power_table" class="table">
<thead>
<tr>
<th></th>
@@ -8,7 +8,7 @@
</tr>
</thead>
<tbody>
<tr rt-repeat="power_datum in this.context.house.power_data" key="{power_datum.scoped_id}">
<tr rt-repeat="power_datum in this.house.power_data" key="{power_datum.scoped_id}">
<td></td>
<td>{power_datum.time_to_s}</td>
<td>{power_datum.consumption_to_s}</td>