1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-22 17:33:14 +01:00

put architecture for transcluding TableItem in place

This commit is contained in:
Tim Daubenschütz 2015-05-22 18:41:15 +02:00
parent 4c0e7992f4
commit 0927d021c9
4 changed files with 23 additions and 4 deletions

View File

@ -9,7 +9,7 @@ class EditionListActions {
);
}
fetchList(pieceId) {
fetchEditionList(pieceId) {
EditionListFetcher
.fetch(pieceId)
.then((res) => {

View File

@ -9,7 +9,7 @@ let Table = React.createClass({
propTypes: {
columnList: React.PropTypes.arrayOf(React.PropTypes.instanceOf(TableColumnContentModel)),
changeOrder: React.PropTypes.func.isRequired
changeOrder: React.PropTypes.func // turn isRequired on again after editions order implemented
},
renderChildren() {

View File

@ -14,6 +14,25 @@ let TableItemSubtable = React.createClass({
columnContent: React.PropTypes.object
},
getInitialState() {
return {
'open': false
};
},
onChange(state) {
this.setState(state);
},
componentDidMount() {
this.props.store.listen(this.onChange);
},
loadEditionList() {
console.log(this.props);
//this.props.actions.actions.fetchEditionList();
},
calcColumnClasses(list, i) {
let bootstrapClasses = ['col-xs-', 'col-sm-', 'col-md-', 'col-lg-'];
@ -49,7 +68,7 @@ let TableItemSubtable = React.createClass({
<div className="row">
{calcColumnElementContent()}
<div className="col-xs-2 col-sm-2 col-md-2 col-lg-2 ascribe-table-item-column">
<TableItemSubtableButton content="Editions">
<TableItemSubtableButton content="Editions" onClick={this.loadEditionList}>
</TableItemSubtableButton>
</div>
</div>

View File

@ -61,7 +61,7 @@ let PieceList = React.createClass({
}
}}>
<Table columnList={columnList} changeOrder={this.tableChangeOrder}>
<TableItemSubtable></TableItemSubtable>
<TableItemSubtable store={EditionListStore} actions={EditionListActions}></TableItemSubtable>
</Table>
<Pagination currentPage={this.props.query.page} goToPage={this.paginationGoToPage} />
</AltContainer>