Quantcast
Channel: GoJS - Northwoods Software
Viewing all articles
Browse latest Browse all 7069

Focus to next created node or object

$
0
0

@Parthi wrote:

Dear Walter,

Happy New Year

In my project i need to focus on next when node/object is creating one by one. I am using flowchart samples in gojs. when a new node is created how to focus to the node. Pls help

I am using the below code for focus the next node.

var nodekey7 = myDiagram.findNodeForKey(“7”);
var nodekey8 = myDiagram.findNodeForKey(“8”);
if (nodekey8.visible == false && nodekey4.visible == true && obj.part.data.key == “7”) {
myDiagram.startTransaction(“make new link”);
myDiagram.model.addLinkData({ from: 7, to: 8, fromPort: “B”, toPort: “T”, visible: true, isHighlighted: true });

                                        myDiagram.commitTransaction("make new link");
                                        nodekey8.visible = true;

                                        myDiagram.nodes.each(function (node) { node.highlight = 0; });
                                        var sel = myDiagram.selection.first();

                                        var nodesToList = new go.List("string");
                                        if (x instanceof go.Link) {
                                            x.fromNode.highlight = i;
                                            nodesToList.add(x.data.from);
                                        } else {
                                            x.findNodesInto().each(function (node) {
                                                node.highlight = i;
                                                node.scrollToPart = true;
                                              
                                            });
                                        }
                                        
                                    }

Refer the below picture for better understanding

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles