[Dojo-interest] Tree to Tree DnD with dijit.Tree - child nodes of dragged node not created

cvconover cconover at vmware.com
Fri Aug 12 01:14:00 EDT 2011


I have two trees with different models & stores. I need to DnD items from
srcTree to trgTree. I have successfully implemented itemCreator to create a
new node in the drop target node, but I can't seem to get the children items
of the dragged node to get created. Here is my implementation. Can anyone
give me some insights on what I am doing wrong?
    trgTreeItemCreator: function(/*DomNode[]*/ nodes, target,
/*dojo.dnd.Source*/ source) {
        console.info("*** start newTreeItemCreator");
        app.reloadNextPages(7);

        //debugger;
        var tmp = dijit.getEnclosingWidget(nodes[0]);
        
        var kids = dojo.map(tmp.item.items, function(kid){
            return {
                "id": kid.id,
                "name": [kid.name[0]],
                "type": [kid.type[0]]
            };
        });
        return [{id:nodes[0].id, name:[tmp.label], type:[tmp.item.type[0]],
items:kids}];
        // also tried putting kids inside square brackets but kids is
already an array - didn't work either
        // return [{id:nodes[0].id, name:[tmp.label],
type:[tmp.item.type[0]], items:kids}];
    },

--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/Tree-to-Tree-DnD-with-dijit-Tree-child-nodes-of-dragged-node-not-created-tp3248327p3248327.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.


More information about the Dojo-interest mailing list