Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 84751

Diagrams with multiple parents

$
0
0

Im trying this:

 

 

addChild: function () {
            var to = diagram.add(diagram.createShape());
            var shapes = diagram.shapes;
            var total = shapes.length;
            alert("total "+total);
            if(total>1){
                
                var toIndex = total-1;
                var from;
                //obtenemos el shape con el id
                var id = diagram.select(diagram.shapes.id);
                alert(id);
                if(id!=""){
                    var i=0;
                    for(i; i < diagram.shapes.length; i++){
                        if(diagram.shapes[i].id == id){
                            from = diagram.shapes[i];
                            break;
                        }
                    }
                    diagram.connect(from, to);
                }
            }
        },

 

butwhat i get is two shapes, and one is undefined


Viewing all articles
Browse latest Browse all 84751

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>