私は、reactjs と material-ui を使用しています。2 つのテーブルを同じビューに異なるデータで配置したいのですが、これまでに取得したのはエラーだけです
const cols = {
amount : { content : 'Amount' },
time : { content : 'Time' },
date : { content : 'Date' },
reason : { content : 'Reason' }
};
const colOrder = [ 'amount', 'time', 'date', 'reason' ];
const rowsIncome = [{
amount : { content : '$895.33' },
time : { content : '22:23 EST' },
date : { content : '07/27/2015' },
reason : { content : 'Reason for income' }
},
{
amount : { content : '$900.33' },
time : { content : '21:43 EST' },
date : { content : '07/29/2015' },
reason : { content : 'Reason for income' }
}];
const rowsOutcome = [{
amount : { content : '$867.66' },
time : { content : '22:23 EST' },
date : { content : '07/24/2015' },
reason : { content : 'Reason for income' }
},
{
amount : { content : '$798.43' },
time : { content : '21:43 EST' },
date : { content : '07/25/2015' },
reason : { content : 'Reason for income' }
}];
export default class PlayersInfo extends Component {
constructor (props) {
super(props);
this.state = { rowData: rowsIncome };
console.log(this.state);
}
static contextTypes = {
router : React.PropTypes.func
}
render () {
return <div className="container">
<Grid>
<h4>Money Income</h4>
<Row>
<Column>
//TABLE WITH ROWSOUTCOME
<Table
headerColumns={cols}
columnOrder={colOrder}
rowData={this.state.rowData.rowsOutcome} />
//TABLE WITH ROWSINCOME
<Table
headerColumns={cols}
columnOrder={colOrder}
rowData={this.state.rowData.rowsIncome} />
</Column>
</Row>
</Grid>;
</div>;
};
}
私が違いを保ちたい情報はconst rowsIncome
、const rowsOutcome
私が理解していないのは、で遊ぶ方法、rowData
次のようなことを許可することです:rowData.rowsOutcome
またはrowData.rowsIncome