This only work on the montage edge branch as it uses the data-arg/data-param system and the edge provided treeController
https://github.com/montagejs/montage/blob/edge/core/tree-controller.js
Example usage:
The actual tree and the specified component to use as the treeNode
<div data-montage-id="fileTree">
<span data-montage-id="fileCell" data-arg="treeNode"></span>
</div>
The serialization that sets up the treeController, treeView, and component to repeat at each level of the tree.
"fileTreeController": {
"prototype": "montage/core/tree-controller",
"properties": {
"childrenPath": "children"
},
"bindings": {
"content": {"<-": "@owner.files"}
}
},
"fileTree": {
"prototype": "ui/tree.reel",
"properties": {
"element": {"#": "fileTree"},
"isSelectionEnabled": true
},
"bindings": {
"treeController": {"<-": "@owner.fileTreeController"}
}
},
"fileCell": {
"prototype": "./file-cell.reel",
"properties": {
"element": {"#": "fileCell"}
},
"bindings": {
"fileInfo": {"<-": "@fileCell.parentComponent.object"},
"iteration": {"<-": "@fileCell.parentComponent.iteration"}
}
}