diff options
Diffstat (limited to 'src/client/views/TempTreeView.tsx')
-rw-r--r-- | src/client/views/TempTreeView.tsx | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/client/views/TempTreeView.tsx b/src/client/views/TempTreeView.tsx new file mode 100644 index 000000000..8dd256c8a --- /dev/null +++ b/src/client/views/TempTreeView.tsx @@ -0,0 +1,47 @@ +import { observable, computed } from "mobx"; +import React = require("react"); +import { observer } from "mobx-react"; +import { Document } from "../../fields/Document"; +import { ListField } from "../../fields/ListField"; +import "./TempTreeView.scss" +import { DocumentManager } from "./DocumentManager"; + +export interface IProps { + mainCollection: Array<Document>; +} + +@observer +export class TempTreeView extends React.Component<IProps>{ + + onClick(doc: Document) { + let view = DocumentManager.Instance.getDocumentView(doc); + if (view != null) { + console.log(view.Id) + console.log(view.props.Document.Title) + if (view.props.ContainingCollectionView != undefined) { + //console.log(view.props.ContainingCollectionView.Id) + } + else { + console.log("containing collection is undefined") + } + } + } + + render() { + return ( + <div className="tempTree"> + <div className="list"> + {this.props.mainCollection.map(doc => { + return ( + <div key={doc.Id} onClick={() => { this.onClick(doc) }}> + {doc.Title} + </div> + ) + } + )} + </div> + </div> + ); + } + +}
\ No newline at end of file |