mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 09:23:13 +01:00
put architecture for transcluding TableItem in place
This commit is contained in:
parent
4c0e7992f4
commit
0927d021c9
@ -9,7 +9,7 @@ class EditionListActions {
|
||||
);
|
||||
}
|
||||
|
||||
fetchList(pieceId) {
|
||||
fetchEditionList(pieceId) {
|
||||
EditionListFetcher
|
||||
.fetch(pieceId)
|
||||
.then((res) => {
|
||||
|
@ -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() {
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user