Login Register

Dijit Cloning

I understand dojo.clone has some enhancements compared to plain node.cloneNode, but after trying unsuccessfully to use dojo.clone on a ContentPane with dijits as children, FilteringSelect, DateTextBox for example, and inserting the cloned ContentPane node with children into an AccordionPane, the objects render fine and are visible, but they have no dijit functionality; they're posers. I try to access the dojoType attribute and it doesn't exist in the child cloned elements, but it does in the ContentPane. Is this currently as intented? Is there any hope of dijit cloning for the future?

*bump* Just trying to get

*bump*

Just trying to get any feedback on how to achieve cloning with dijit children and retaining all dijit functionality like OP asks. I have the same problem. Is this possible?

I want to know too :)!!

somebody help....:):):)!!

it is currently not

it is currently not possible. While it is possible to clone the markup that is a result of a dijit rendering, it is not possible to clone to behaviors the widget lifecycle generates (connections to certain nodes, etc etc) ...

One way I work "around" this issue is by turning the block of widgets i want to repeat into a widget itself, and then create a new instance of that widget every time. This does all the lifecycle requirements, and gives me an identical clone, and then I delegate between however many iterations I've created for my data.

Hope this helps.

Regards,
Peter Higgins