Open muser83 opened 10 years ago
Is it possible to get all blocks in a ordered hierarchical structure?
Hello,
Composite blocks are temp variables only created when moving a block and are not registered in the blocks array of the controller. If by composite you mean having a flexy layout inside another flexy layout, I would suggest you could write a directive or add a behavior to the existing one to parse the dom and find the proper block structure, (looking for div with class "block-content"unfortunatelly I have no time to do it at the moment.
But why do you want to access the whole structure programmaticallly ? you can have a look at the markup which is already somehow a treeview
Hi,
I was looking for the same thing, getting the block structure would be useful to target specific elements in a children or different Flexy-layout (not accessible via the API), i.e.
A toolbar: [Toggle vp1][...]
When from toolbar I access the API (directive > scope) there are only 2 blocks (2 rows), so I cannot close/change any vp# with: ctrl.moveBlockLength(index, false);
I end up modifying your collapse directive and adding an ugly hack to keep track of blocks and their controllers. It's working but I'm pretty sure it can be better done. Any advice would be appreciated!
http://plnkr.co/edit/r2gimFsT5XWt6Q5UWp0k?p=preview
Thanks
How can I get the full tree structure?
Traversing in the blocks array of flexyLayout cannot get composite blocks (blocks with blocks inside)