I use an example of an alloy shape. here . An example that he provides is a hierarchy of two levels, and I'm trying to expand it to four.
It has javascript functions to add nested elements. How to expand for four nested layers?
'.add_nested_item': function(e){ el = Event.findElement(e); template = eval(el.href.replace(/.*#/, '')) $(el.rel).insert({ bottom: replace_ids(template) }); }, '.add_nested_item_lvl2': function(e){ el = Event.findElement(e); elements = el.rel.match(/(\w+)/g) parent = '.'+elements[0] child = '.'+elements[1] child_container = el.up(parent).down(child) parent_object_id = el.up(parent).down('input').name.match(/.*\[(\d+)\]/)[1] template = eval(el.href.replace(/.*#/, '')) template = template.replace(/(attributes[_\]\[]+)\d+/g, "$1"+parent_object_id)
source share